Skip to content

Commit 93c664a

Browse files
committed
Update result record, config, instructions and tests
1 parent bc0739a commit 93c664a

6 files changed

Lines changed: 123 additions & 47 deletions

File tree

exercises/practice/camicia/.docs/instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Instructions
22

3-
In this exercise, you will simulate a game very similar to the classic card game **CamiciaGame**.
3+
In this exercise, you will simulate a game very similar to the classic card game **Camicia**.
44
Your program will receive the initial configuration of two players' decks and must simulate the game until it ends (or detect that it will never end).
55

66
## Rules
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Introduction
2+
3+
One rainy afternoon, you sit at the kitchen table playing cards with your grandmother.
4+
The game is her take on [Camicia][bmn].
5+
6+
At first it feels like just another friendly match: cards slapped down, laughter across the table, the occasional victorious grin from Nonna.
7+
But as the game stretches on, something strange happens.
8+
The same cards keep cycling back.
9+
You play card after card, yet the end never seems to come.
10+
11+
You start to wonder.
12+
_Will this game ever finish?
13+
Or could we keep playing forever?_
14+
15+
Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn't just bad luck.
16+
You and your grandmother may have stumbled upon one of the longest possible sequences!
17+
Suddenly, you're hooked.
18+
What began as a casual game has turned into a quest: _how long can such a game really last?_
19+
_Can you find a sequence even longer than the one you played at the kitchen table?_
20+
_Perhaps even long enough to set a new world record?_
21+
22+
And so, armed with nothing but a deck of cards and some algorithmic ingenuity, you decide to investigate...
23+
24+
[bmn]: https://en.wikipedia.org/wiki/Beggar-my-neighbour

exercises/practice/camicia/.meta/config.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
"contributors": [],
66
"files": {
77
"solution": [
8-
"src/main/java/Camicia.java"
8+
"src/main/java/Camicia.java",
9+
"src/main/java/CamiciaResult.java"
910
],
1011
"test": [
1112
"src/test/java/CamiciaTest.java"
1213
],
1314
"example": [
14-
".meta/src/reference/java/Camicia.java"
15+
".meta/src/reference/java/Camicia.java",
16+
".meta/src/reference/java/CamiciaResult.java"
1517
],
1618
"invalidator": [
1719
"build.gradle"

exercises/practice/camicia/.meta/src/reference/java/CamiciaResult.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,4 @@
33
*/
44
public record CamiciaResult(String status, int cards, int tricks) {
55

6-
/**
7-
* @return the game status
8-
*/
9-
public String status() {
10-
return status;
11-
}
12-
13-
/**
14-
* @return the total played cards
15-
*/
16-
public int cards() {
17-
return cards;
18-
}
19-
20-
/**
21-
* @return the total tricks used
22-
*/
23-
public int tricks() {
24-
return tricks;
25-
}
266
}
27-
28-
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
11+
12+
[0b7f737c-3ecd-4a55-b34d-e65c62a85c28]
13+
description = "two cards, one trick"
14+
15+
[27c19d75-53a5-48e5-b33b-232c3884d4f3]
16+
description = "three cards, one trick"
17+
18+
[9b02dd49-efaf-4b71-adca-a05c18a7c5b0]
19+
description = "four cards, one trick"
20+
21+
[fa3f4479-466a-4734-a001-ab79bfe27260]
22+
description = "the ace reigns supreme"
23+
24+
[07629689-f589-4f54-a6d1-8ce22776ce72]
25+
description = "the king beats ace"
26+
27+
[54d4a1c5-76fb-4d1e-8358-0e0296ac0601]
28+
description = "the queen seduces the king"
29+
30+
[c875500c-ff3d-47a4-bd1e-b60b90da80aa]
31+
description = "the jack betrays the queen"
32+
33+
[436875da-96ca-4149-be22-0b78173b8125]
34+
description = "the 10 just wants to put on a show"
35+
36+
[5be39bb6-1b34-4ce6-a1cd-0fcc142bb272]
37+
description = "simple loop with decks of 3 cards"
38+
39+
[2795dc21-0a2a-4c38-87c2-5a42e1ff15eb]
40+
description = "the story is starting to get a bit complicated"
41+
42+
[6999dfac-3fdc-41e2-b64b-38f4be228712]
43+
description = "two tricks"
44+
45+
[83dcd4f3-e089-4d54-855a-73f5346543a3]
46+
description = "more tricks"
47+
48+
[3107985a-f43e-486a-9ce8-db51547a9941]
49+
description = "simple loop with decks of 4 cards"
50+
51+
[dca32c31-11ed-49f6-b078-79ab912c1f7b]
52+
description = "easy card combination"
53+
54+
[1f8488d0-48d3-45ae-b819-59cedad0a5f4]
55+
description = "easy card combination, inverted decks"
56+
57+
[98878d35-623a-4d05-b81a-7bdc569eb88d]
58+
description = "mirrored decks"
59+
60+
[3e0ba597-ca10-484b-87a3-31a7df7d6da3]
61+
description = "opposite decks"
62+
63+
[92334ddb-aaa7-47fa-ab36-e928a8a6a67c]
64+
description = "random decks #1"
65+
66+
[30477523-9651-4860-84a3-e1ac461bb7fa]
67+
description = "random decks #2"
68+
69+
[20967de8-9e94-4e0e-9010-14bc1c157432]
70+
description = "Kleber 1999"
71+
72+
[9f2fdfe8-27f3-4323-816d-6bce98a9c6f7]
73+
description = "Collins 2006"
74+
75+
[c90b6f8d-7013-49f3-b5cb-14ea006cca1d]
76+
description = "Mann and Wu 2007"
77+
78+
[a3f1fbc5-1d0b-499a-92a5-22932dfc6bc8]
79+
description = "Nessler 2012"
80+
81+
[9cefb1ba-e6d1-4ab7-9d8f-76d8e0976d5f]
82+
description = "Anderson 2013"
83+
84+
[d37c0318-5be6-48d0-ab72-a7aaaff86179]
85+
description = "Rucklidge 2014"
86+
87+
[4305e479-ba87-432f-8a29-cd2bd75d2f05]
88+
description = "Nessler 2021"
89+
90+
[252f5cc3-b86d-4251-87ce-f920b7a6a559]
91+
description = "Nessler 2022"
92+
93+
[b9efcfa4-842f-4542-8112-8389c714d958]
94+
description = "Casella 2024, first infinite game found"

exercises/practice/camicia/src/main/java/CamiciaResult.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,4 @@
33
*/
44
public record CamiciaResult(String status, int cards, int tricks) {
55

6-
/**
7-
* @return the game status
8-
*/
9-
public String status() {
10-
return status;
11-
}
12-
13-
/**
14-
* @return the total played cards
15-
*/
16-
public int cards() {
17-
return cards;
18-
}
19-
20-
/**
21-
* @return the total tricks used
22-
*/
23-
public int tricks() {
24-
return tricks;
25-
}
266
}
27-
28-

0 commit comments

Comments
 (0)