From 56206ed0c7009b1d66e7f75977d23ff108fb4a92 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sat, 30 Aug 2025 20:49:01 +0200 Subject: [PATCH 01/79] added new exercise: camicia --- exercises/camicia/canonical-data.json | 215 ++++++++++++++++++++++++++ exercises/camicia/instructions.md | 58 +++++++ exercises/camicia/introduction.md | 16 ++ exercises/camicia/metadata.toml | 4 + 4 files changed, 293 insertions(+) create mode 100644 exercises/camicia/canonical-data.json create mode 100644 exercises/camicia/instructions.md create mode 100644 exercises/camicia/introduction.md create mode 100644 exercises/camicia/metadata.toml diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json new file mode 100644 index 0000000000..e45129a66d --- /dev/null +++ b/exercises/camicia/canonical-data.json @@ -0,0 +1,215 @@ +{ + "exercise": "beggar-my-neighbour", + "cases": [ + { + "uuid": "dca32c31-11ed-49f6-b078-79ab912c1f7b", + "description": "easy card combination", + "property": "findEndGame", + "input": { + "playerA": "--------------------------", + "playerB": "----------AAAAKKKKQQQQJJJJ" + }, + "expected": { + "status": "finished", + "cards": 40, + "tricks": 4 + } + }, + { + "uuid": "1f8488d0-48d3-45ae-b819-59cedad0a5f4", + "description": "easy card combination, inverted decks", + "property": "findEndGame", + "input": { + "playerA": "----------AAAAKKKKQQQQJJJJ", + "playerB": "--------------------------" + }, + "expected": { + "status": "finished", + "cards": 40, + "tricks": 4 + } + }, + { + "uuid": "98878d35-623a-4d05-b81a-7bdc569eb88d", + "description": "mirrored decks", + "property": "findEndGame", + "input": { + "playerA": "-A-A-K-K-Q-Q-J-J----------", + "playerB": "-A-A-K-K-Q-Q-J-J----------" + }, + "expected": { + "status": "finished", + "cards": 59, + "tricks": 4 + } + }, + { + "uuid": "3e0ba597-ca10-484b-87a3-31a7df7d6da3", + "description": "opposite decks", + "property": "findEndGame", + "input": { + "playerA": "-A-A-K-K-Q-Q-J-J----------", + "playerB": "----------J-J-Q-Q-K-K-A-A-" + }, + "expected": { + "status": "finished", + "cards": 151, + "tricks": 21 + } + }, + { + "uuid": "92334ddb-aaa7-47fa-ab36-e928a8a6a67c", + "description": "random decks #1", + "property": "findEndGame", + "input": { + "playerA": "K---J----AK---J-J---------", + "playerB": "--KAQ-A-Q-----Q-K--A-Q-J--" + }, + "expected": { + "status": "finished", + "cards": 542, + "tricks": 76 + } + }, + { + "uuid": "30477523-9651-4860-84a3-e1ac461bb7fa", + "description": "random decks #2", + "property": "findEndGame", + "input": { + "playerA": "-A---QJ-----KA--K---K---K-", + "playerB": "----QJA------JA-Q-JQ------" + }, + "expected": { + "status": "finished", + "cards": 327, + "tricks": 42 + } + }, + { + "uuid": "20967de8-9e94-4e0e-9010-14bc1c157432", + "description": "Kleber 1999", + "property": "findEndGame", + "input": { + "playerA": "---JQ---K-A----A-J-K---QK-", + "playerB": "-J-----------AJQA----K---Q" + }, + "expected": { + "status": "finished", + "cards": 5790, + "tricks": 805 + } + }, + { + "uuid": "9f2fdfe8-27f3-4323-816d-6bce98a9c6f7", + "description": "Collins 2006", + "property": "findEndGame", + "input": { + "playerA": "A-QK------Q----KA-----J---", + "playerB": "-JAK----A--Q----J---QJ--K-" + }, + "expected": { + "status": "finished", + "cards": 6913, + "tricks": 960 + } + }, + { + "uuid": "c90b6f8d-7013-49f3-b5cb-14ea006cca1d", + "description": "Mann and Wu 2007", + "property": "findEndGame", + "input": { + "playerA": "K-KK----K-A-----JAA--Q--J-", + "playerB": "---Q---Q-J-----J------AQ--" + }, + "expected": { + "status": "finished", + "cards": 7157, + "tricks": 1007 + } + }, + { + "uuid": "a3f1fbc5-1d0b-499a-92a5-22932dfc6bc8", + "description": "Nessler 2012", + "property": "findEndGame", + "input": { + "playerA": "----Q------A--K--A-A--QJK-", + "playerB": "-Q--J--J---QK---K----JA---" + }, + "expected": { + "status": "finished", + "cards": 7207, + "tricks": 1015 + } + }, + { + "uuid": "9cefb1ba-e6d1-4ab7-9d8f-76d8e0976d5f", + "description": "Anderson 2013", + "property": "findEndGame", + "input": { + "playerA": "--A-Q--J--J---Q--AJ-K---K-", + "playerB": "-J-------Q------A--A--QKK-" + }, + "expected": { + "status": "finished", + "cards": 7225, + "tricks": 1016 + } + }, + { + "uuid": "d37c0318-5be6-48d0-ab72-a7aaaff86179", + "description": "Rucklidge 2014", + "property": "findEndGame", + "input": { + "playerA": "-J------Q------AAA-----QQ-", + "playerB": "K----JA-----------KQ-K-JJK" + }, + "expected": { + "status": "finished", + "cards": 7959, + "tricks": 1122 + } + }, + { + "uuid": "4305e479-ba87-432f-8a29-cd2bd75d2f05", + "description": "Nessler 2021", + "property": "findEndGame", + "input": { + "playerA": "----K---A--Q-A--JJA------J", + "playerB": "-----KK---------A-JK-Q-Q-Q" + }, + "expected": { + "status": "finished", + "cards": 7972, + "tricks": 1106 + } + }, + { + "uuid": "252f5cc3-b86d-4251-87ce-f920b7a6a559", + "description": "Nessler 2022", + "property": "findEndGame", + "input": { + "playerA": "---AJ--Q---------QAKQJJ-QK", + "playerB": "-----A----KJ-K--------A---" + }, + "expected": { + "status": "finished", + "cards": 8344, + "tricks": 1164 + } + }, + { + "uuid": "b9efcfa4-842f-4542-8112-8389c714d958", + "description": "Casella 2024, first infinite game found", + "property": "findEndGame", + "input": { + "playerA": "---K---Q-KQAJ-----AAJ--J--", + "playerB": "----------Q----KQ-J-----KA" + }, + "expected": { + "status": "loop", + "cards": 474, + "tricks": 66 + } + } + ] +} \ No newline at end of file diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md new file mode 100644 index 0000000000..f98720fed2 --- /dev/null +++ b/exercises/camicia/instructions.md @@ -0,0 +1,58 @@ +# Instructions + +In this exercise, you will simulate the classic card game **Beggar-my-neighbour** (*Camicia*). +Your program will receive the initial configuration of two players’ decks and must simulate the game until it ends (or detect if it never does). + +## Rules + +* The deck is split between **two players**. Each player’s cards are represented as a string (top of the deck = leftmost character). + +* Players take turns placing the **top card** of their deck onto a central pile. + +* If the card is a **number card** (`-` in this scenario), play simply passes to the other player. + +* If the card is a **payment card**: + + * `J` → opponent must pay 1 card + * `Q` → opponent must pay 2 cards + * `K` → opponent must pay 3 cards + * `A` → opponent must pay 4 cards + +* While paying, if the opponent reveals another payment card, the penalty immediately switches back. + +* If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. That player also starts the next round. + +* The game ends when one player has no more cards. + +## Example + +Here’s a simple example of input and output. + +```json +"input": { + "playerA": "--------------------------", + "playerB": "----------AAAAKKKKQQQQJJJJ" +}, +"output": { + "status": "finished", + "cards": 40, + "tricks": 4 +} +``` + +### Explanation: + +* Player A only has number cards (`-`), so can never defend against a payment card. +* Player B has a long sequence of Aces, Kings, Queens, and Jacks. +* Each court card forces penalties, which Player A cannot counterattack, so Player B repeatedly wins the pile. +* In the end, player B captures his opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). + +## Your Task + +* Parse the two players’ decks from the input. +* Simulate the game following the rules above. +* Return the result as an object with: + + * `"status"`: `"finished"` or `"loop"` + * `"cards"`: total number of cards played throughout the game + * `"tricks"`: number of times the central pile was collected \ No newline at end of file diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md new file mode 100644 index 0000000000..fa6c222f19 --- /dev/null +++ b/exercises/camicia/introduction.md @@ -0,0 +1,16 @@ +# Introduction + +One rainy afternoon, you sit at the kitchen table playing cards with your grandmother. +The game is [Beggar-my-neighbour][bmn], or as she calls it, “Camicia.” +At first it feels like just another friendly match: cards slapped down, laughter across the table, the occasional victorious grin from Nonna. +But as the game drags on, something strange happens. The pile keeps growing. You play card after card, yet the end never seems to come. + +You start to wonder: _Will this game ever finish? Or could we keep playing forever?_ + +Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn’t just bad luck. +You and your grandmother may have stumbled upon one of the longest possible sequences! +Suddenly, you’re hooked. What began as a casual game has turned into a quest: _How long can such a game really last? Can you find a sequence even longer than the one you played at the kitchen table? Perhaps even long enough to set a new world record?_ + +And so, armed with nothing but a deck of cards and some algorithmic ingenuity, you decide to investigate… + +[bmn]: https://en.wikipedia.org/wiki/Beggar-my-neighbour \ No newline at end of file diff --git a/exercises/camicia/metadata.toml b/exercises/camicia/metadata.toml new file mode 100644 index 0000000000..c0e441ce74 --- /dev/null +++ b/exercises/camicia/metadata.toml @@ -0,0 +1,4 @@ +title = "Camicia" +blurb = "Simulate the card game and determine whether the match ends or enters an infinite loop." +source = "Beggar-My-Neighbour" +source_url = "https://www.richardpmann.com/beggar-my-neighbour-records.html" From 60e92fdc682e9a3b94c4b2f0f06d762e7ef2657d Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sat, 30 Aug 2025 21:55:08 +0200 Subject: [PATCH 02/79] fixed introduction indentation --- exercises/camicia/introduction.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index fa6c222f19..562822062e 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -1,15 +1,24 @@ # Introduction -One rainy afternoon, you sit at the kitchen table playing cards with your grandmother. +One rainy afternoon, you sit at the kitchen table playing cards with your grandmother.\ The game is [Beggar-my-neighbour][bmn], or as she calls it, “Camicia.” -At first it feels like just another friendly match: cards slapped down, laughter across the table, the occasional victorious grin from Nonna. -But as the game drags on, something strange happens. The pile keeps growing. You play card after card, yet the end never seems to come. -You start to wonder: _Will this game ever finish? Or could we keep playing forever?_ +At first it feels like just another friendly match:\ +cards slapped down, laughter across the table, the occasional victorious grin from Nonna.\ +But as the game drags on, something strange happens.\ +The pile keeps growing.\ +You play card after card, yet the end never seems to come. -Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn’t just bad luck. -You and your grandmother may have stumbled upon one of the longest possible sequences! -Suddenly, you’re hooked. What began as a casual game has turned into a quest: _How long can such a game really last? Can you find a sequence even longer than the one you played at the kitchen table? Perhaps even long enough to set a new world record?_ +You start to wonder:\ +_Will this game ever finish? Or could we keep playing forever?_ + +Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn’t just bad luck.\ +You and your grandmother may have stumbled upon one of the longest possible sequences!\ +Suddenly, you’re hooked.\ +What began as a casual game has turned into a quest:\ +_How long can such a game really last?_\ +_Can you find a sequence even longer than the one you played at the kitchen table?_\ +_Perhaps even long enough to set a new world record?_ And so, armed with nothing but a deck of cards and some algorithmic ingenuity, you decide to investigate… From d916018e53319293e9250f5cd15346420ab8201d Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sat, 30 Aug 2025 21:57:24 +0200 Subject: [PATCH 03/79] changed property in canonical-data --- exercises/camicia/canonical-data.json | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index e45129a66d..ea7c2de95a 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -4,7 +4,7 @@ { "uuid": "dca32c31-11ed-49f6-b078-79ab912c1f7b", "description": "easy card combination", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "--------------------------", "playerB": "----------AAAAKKKKQQQQJJJJ" @@ -18,7 +18,7 @@ { "uuid": "1f8488d0-48d3-45ae-b819-59cedad0a5f4", "description": "easy card combination, inverted decks", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "----------AAAAKKKKQQQQJJJJ", "playerB": "--------------------------" @@ -32,7 +32,7 @@ { "uuid": "98878d35-623a-4d05-b81a-7bdc569eb88d", "description": "mirrored decks", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "-A-A-K-K-Q-Q-J-J----------", "playerB": "-A-A-K-K-Q-Q-J-J----------" @@ -46,7 +46,7 @@ { "uuid": "3e0ba597-ca10-484b-87a3-31a7df7d6da3", "description": "opposite decks", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "-A-A-K-K-Q-Q-J-J----------", "playerB": "----------J-J-Q-Q-K-K-A-A-" @@ -60,7 +60,7 @@ { "uuid": "92334ddb-aaa7-47fa-ab36-e928a8a6a67c", "description": "random decks #1", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "K---J----AK---J-J---------", "playerB": "--KAQ-A-Q-----Q-K--A-Q-J--" @@ -74,7 +74,7 @@ { "uuid": "30477523-9651-4860-84a3-e1ac461bb7fa", "description": "random decks #2", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "-A---QJ-----KA--K---K---K-", "playerB": "----QJA------JA-Q-JQ------" @@ -88,7 +88,7 @@ { "uuid": "20967de8-9e94-4e0e-9010-14bc1c157432", "description": "Kleber 1999", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "---JQ---K-A----A-J-K---QK-", "playerB": "-J-----------AJQA----K---Q" @@ -102,7 +102,7 @@ { "uuid": "9f2fdfe8-27f3-4323-816d-6bce98a9c6f7", "description": "Collins 2006", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "A-QK------Q----KA-----J---", "playerB": "-JAK----A--Q----J---QJ--K-" @@ -116,7 +116,7 @@ { "uuid": "c90b6f8d-7013-49f3-b5cb-14ea006cca1d", "description": "Mann and Wu 2007", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "K-KK----K-A-----JAA--Q--J-", "playerB": "---Q---Q-J-----J------AQ--" @@ -130,7 +130,7 @@ { "uuid": "a3f1fbc5-1d0b-499a-92a5-22932dfc6bc8", "description": "Nessler 2012", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "----Q------A--K--A-A--QJK-", "playerB": "-Q--J--J---QK---K----JA---" @@ -144,7 +144,7 @@ { "uuid": "9cefb1ba-e6d1-4ab7-9d8f-76d8e0976d5f", "description": "Anderson 2013", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "--A-Q--J--J---Q--AJ-K---K-", "playerB": "-J-------Q------A--A--QKK-" @@ -158,7 +158,7 @@ { "uuid": "d37c0318-5be6-48d0-ab72-a7aaaff86179", "description": "Rucklidge 2014", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "-J------Q------AAA-----QQ-", "playerB": "K----JA-----------KQ-K-JJK" @@ -172,7 +172,7 @@ { "uuid": "4305e479-ba87-432f-8a29-cd2bd75d2f05", "description": "Nessler 2021", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "----K---A--Q-A--JJA------J", "playerB": "-----KK---------A-JK-Q-Q-Q" @@ -186,7 +186,7 @@ { "uuid": "252f5cc3-b86d-4251-87ce-f920b7a6a559", "description": "Nessler 2022", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "---AJ--Q---------QAKQJJ-QK", "playerB": "-----A----KJ-K--------A---" @@ -200,7 +200,7 @@ { "uuid": "b9efcfa4-842f-4542-8112-8389c714d958", "description": "Casella 2024, first infinite game found", - "property": "findEndGame", + "property": "simulateGame", "input": { "playerA": "---K---Q-KQAJ-----AAJ--J--", "playerB": "----------Q----KQ-J-----KA" From fef539813b669ab545355b5dcaedd191df832d8f Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sat, 30 Aug 2025 21:58:22 +0200 Subject: [PATCH 04/79] changed exercise name in canonical-data --- exercises/camicia/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index ea7c2de95a..2e41d318a6 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -1,5 +1,5 @@ { - "exercise": "beggar-my-neighbour", + "exercise": "camicia", "cases": [ { "uuid": "dca32c31-11ed-49f6-b078-79ab912c1f7b", From e772c42ba8ed52ecc4481910e98b48cec63a6a16 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:29:52 +0200 Subject: [PATCH 05/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index f98720fed2..9939afb73b 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -51,7 +51,7 @@ Here’s a simple example of input and output. * Parse the two players’ decks from the input. * Simulate the game following the rules above. -* Return the result as an object with: +* Determine is the final game status is `"finished"` or `"loop"`. * `"status"`: `"finished"` or `"loop"` * `"cards"`: total number of cards played throughout the game From bb05688e8dc18592c493cf7f28c028a7bb0a6e4f Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:30:29 +0200 Subject: [PATCH 06/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 9939afb73b..c84194d155 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -1,6 +1,6 @@ # Instructions -In this exercise, you will simulate the classic card game **Beggar-my-neighbour** (*Camicia*). +In this exercise, you will simulate the classic card game **Camicia**. Your program will receive the initial configuration of two players’ decks and must simulate the game until it ends (or detect if it never does). ## Rules From 1a000e2cf750a9a24083d2cd90ef06a28de99558 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:30:39 +0200 Subject: [PATCH 07/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index c84194d155..df66452694 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -1,7 +1,7 @@ # Instructions In this exercise, you will simulate the classic card game **Camicia**. -Your program will receive the initial configuration of two players’ decks and must simulate the game until it ends (or detect if it never does). +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). ## Rules From b594c8c8b6162486a6ba39be6813a025e0dd6f99 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:30:52 +0200 Subject: [PATCH 08/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index df66452694..1d64b8b895 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -5,7 +5,8 @@ Your program will receive the initial configuration of two players’ decks and ## Rules -* The deck is split between **two players**. Each player’s cards are represented as a string (top of the deck = leftmost character). +* The deck is split between **two players**. + Each player's cards are represented as a string where the leftmost character is the top of the deck. * Players take turns placing the **top card** of their deck onto a central pile. From 6406758d767a363eeb33cdf478b8e8cb96ab948e Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:31:24 +0200 Subject: [PATCH 09/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 1d64b8b895..915eeeab15 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -21,7 +21,8 @@ Your program will receive the initial configuration of two players’ decks and * While paying, if the opponent reveals another payment card, the penalty immediately switches back. -* If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. That player also starts the next round. +* If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. + That player then starts the next round. * The game ends when one player has no more cards. From cdc0aa46181c6617c90870c51711bf89c7694250 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:31:44 +0200 Subject: [PATCH 10/79] Update exercises/camicia/introduction.md Co-authored-by: Isaac Good --- exercises/camicia/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index 562822062e..129fe68f62 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -1,7 +1,7 @@ # Introduction One rainy afternoon, you sit at the kitchen table playing cards with your grandmother.\ -The game is [Beggar-my-neighbour][bmn], or as she calls it, “Camicia.” +The game is [Camica][bmn]. At first it feels like just another friendly match:\ cards slapped down, laughter across the table, the occasional victorious grin from Nonna.\ From 2b0e18f339f5012521f08f89a0fde1f983d2865b Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:35:52 +0200 Subject: [PATCH 11/79] Update exercises/camicia/introduction.md Co-authored-by: Isaac Good --- exercises/camicia/introduction.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index 129fe68f62..b7da5566d0 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -3,10 +3,9 @@ One rainy afternoon, you sit at the kitchen table playing cards with your grandmother.\ The game is [Camica][bmn]. -At first it feels like just another friendly match:\ -cards slapped down, laughter across the table, the occasional victorious grin from Nonna.\ -But as the game drags on, something strange happens.\ -The pile keeps growing.\ +At first it feels like just another friendly match: cards slapped down, laughter across the table, the occasional victorious grin from Nonna. +But as the game drags on, something strange happens. +The pile keeps growing. You play card after card, yet the end never seems to come. You start to wonder:\ From 87bc176b79ce46a22e46d81ca52bad2b5fb1dfcf Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:36:00 +0200 Subject: [PATCH 12/79] Update exercises/camicia/introduction.md Co-authored-by: Isaac Good --- exercises/camicia/introduction.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index b7da5566d0..fc2d283a35 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -8,8 +8,9 @@ But as the game drags on, something strange happens. The pile keeps growing. You play card after card, yet the end never seems to come. -You start to wonder:\ -_Will this game ever finish? Or could we keep playing forever?_ +You start to wonder. +_Will this game ever finish? +Or could we keep playing forever?_ Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn’t just bad luck.\ You and your grandmother may have stumbled upon one of the longest possible sequences!\ From 58c1370fb0e51d83ece4ecfb021dd368a0d62cf7 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:36:09 +0200 Subject: [PATCH 13/79] Update exercises/camicia/introduction.md Co-authored-by: Isaac Good --- exercises/camicia/introduction.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index fc2d283a35..018f8d6835 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -12,12 +12,11 @@ You start to wonder. _Will this game ever finish? Or could we keep playing forever?_ -Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn’t just bad luck.\ -You and your grandmother may have stumbled upon one of the longest possible sequences!\ -Suddenly, you’re hooked.\ -What began as a casual game has turned into a quest:\ -_How long can such a game really last?_\ -_Can you find a sequence even longer than the one you played at the kitchen table?_\ +Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn’t just bad luck. +You and your grandmother may have stumbled upon one of the longest possible sequences! +Suddenly, you're hooked. +What began as a casual game has turned into a quest: _how long can such a game really last?_ +_Can you find a sequence even longer than the one you played at the kitchen table?_ _Perhaps even long enough to set a new world record?_ And so, armed with nothing but a deck of cards and some algorithmic ingenuity, you decide to investigate… From d83bde22ba67b40b32ecfb63b816ef90dd45b870 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:36:42 +0200 Subject: [PATCH 14/79] Update exercises/camicia/introduction.md Co-authored-by: Isaac Good --- exercises/camicia/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index 018f8d6835..ad349ef9de 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -19,6 +19,6 @@ What began as a casual game has turned into a quest: _how long can such a game r _Can you find a sequence even longer than the one you played at the kitchen table?_ _Perhaps even long enough to set a new world record?_ -And so, armed with nothing but a deck of cards and some algorithmic ingenuity, you decide to investigate… +And so, armed with nothing but a deck of cards and some algorithmic ingenuity, you decide to investigate... [bmn]: https://en.wikipedia.org/wiki/Beggar-my-neighbour \ No newline at end of file From 2e1b1efcd4e44a946f40c1750745ee291b021513 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:37:02 +0200 Subject: [PATCH 15/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 915eeeab15..4a351bf342 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -12,7 +12,7 @@ Your program will receive the initial configuration of two players’ decks and * If the card is a **number card** (`-` in this scenario), play simply passes to the other player. -* If the card is a **payment card**: +* If the card is a **payment card**, a price needs to be paid: * `J` → opponent must pay 1 card * `Q` → opponent must pay 2 cards From ae537626847ece6d37db27515aec8925f042b7cb Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:38:13 +0200 Subject: [PATCH 16/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 4a351bf342..184b24f440 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -19,7 +19,7 @@ Your program will receive the initial configuration of two players’ decks and * `K` → opponent must pay 3 cards * `A` → opponent must pay 4 cards -* While paying, if the opponent reveals another payment card, the penalty immediately switches back. +* If the player paying a penalty reveals another payment card, that player stops paying the penalty and the other player much then pay the penalty. * If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. That player then starts the next round. From 1b21ff58831fd9994f3414ad3a4a1b4c99bc0988 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:39:58 +0200 Subject: [PATCH 17/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 184b24f440..959c641384 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -42,7 +42,7 @@ Here’s a simple example of input and output. } ``` -### Explanation: +### Explanation * Player A only has number cards (`-`), so can never defend against a payment card. * Player B has a long sequence of Aces, Kings, Queens, and Jacks. From 7ad115e09abecbabe1f3c144f63a61398460b477 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:40:32 +0200 Subject: [PATCH 18/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 959c641384..a6fc864b24 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -44,7 +44,7 @@ Here’s a simple example of input and output. ### Explanation -* Player A only has number cards (`-`), so can never defend against a payment card. +* Player A only has number cards, so can never defend against a payment card. * Player B has a long sequence of Aces, Kings, Queens, and Jacks. * Each court card forces penalties, which Player A cannot counterattack, so Player B repeatedly wins the pile. * In the end, player B captures his opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). From 297ccc4ae1ddfdb19f50bc66118944d30abe44a4 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:41:14 +0200 Subject: [PATCH 19/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index a6fc864b24..bf51132675 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -45,7 +45,7 @@ Here’s a simple example of input and output. ### Explanation * Player A only has number cards, so can never defend against a payment card. -* Player B has a long sequence of Aces, Kings, Queens, and Jacks. +* Player B has a long sequence of payment cards: Aces, Kings, Queens, and Jacks. * Each court card forces penalties, which Player A cannot counterattack, so Player B repeatedly wins the pile. * In the end, player B captures his opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). From b2ea69b72afc05e1ac03c75c4f7b9a53284d6cb6 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:41:39 +0200 Subject: [PATCH 20/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index bf51132675..2332d4948a 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -46,7 +46,7 @@ Here’s a simple example of input and output. * Player A only has number cards, so can never defend against a payment card. * Player B has a long sequence of payment cards: Aces, Kings, Queens, and Jacks. -* Each court card forces penalties, which Player A cannot counterattack, so Player B repeatedly wins the pile. +* Each payment card forces a payment, which Player A cannot counter with a payment card of their own, so Player B repeatedly wins the pile (repeatedly completes a trick). * In the end, player B captures his opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). ## Your Task From c179aebff058c5f2f8c0b4a02d8054a0eea908b2 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:41:58 +0200 Subject: [PATCH 21/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 2332d4948a..be202d5e02 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -47,7 +47,7 @@ Here’s a simple example of input and output. * Player A only has number cards, so can never defend against a payment card. * Player B has a long sequence of payment cards: Aces, Kings, Queens, and Jacks. * Each payment card forces a payment, which Player A cannot counter with a payment card of their own, so Player B repeatedly wins the pile (repeatedly completes a trick). -* In the end, player B captures his opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). +* In the end, player B captures their opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). ## Your Task From 02701c8c85fea6a31ab7864331af65eddeb04f62 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:42:10 +0200 Subject: [PATCH 22/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index be202d5e02..35445423e8 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -55,6 +55,6 @@ Here’s a simple example of input and output. * Simulate the game following the rules above. * Determine is the final game status is `"finished"` or `"loop"`. - * `"status"`: `"finished"` or `"loop"` + * `"status"`: `"finished"` or `"loop"` * `"cards"`: total number of cards played throughout the game * `"tricks"`: number of times the central pile was collected \ No newline at end of file From 8d043673edb13db2cfec5554e927a46d399439ab Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:42:31 +0200 Subject: [PATCH 23/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 35445423e8..777a8f24f9 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -56,5 +56,5 @@ Here’s a simple example of input and output. * Determine is the final game status is `"finished"` or `"loop"`. * `"status"`: `"finished"` or `"loop"` - * `"cards"`: total number of cards played throughout the game + * `"cards"`: total number of cards played throughout the game * `"tricks"`: number of times the central pile was collected \ No newline at end of file From b1b0759941fad317ee00c011c1515c91df3f42e1 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:42:40 +0200 Subject: [PATCH 24/79] Update exercises/camicia/instructions.md Co-authored-by: Derk-Jan Karrenbeld --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 777a8f24f9..d2811e9fcc 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -57,4 +57,4 @@ Here’s a simple example of input and output. * `"status"`: `"finished"` or `"loop"` * `"cards"`: total number of cards played throughout the game - * `"tricks"`: number of times the central pile was collected \ No newline at end of file + * `"tricks"`: number of times the central pile was collected \ No newline at end of file From 38ce1f30ba6a5c06171b2b9ce09ac7a767b7ece3 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 31 Aug 2025 10:49:22 +0200 Subject: [PATCH 25/79] fixed typo in introduction --- exercises/camicia/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index ad349ef9de..05b1318c61 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -1,7 +1,7 @@ # Introduction One rainy afternoon, you sit at the kitchen table playing cards with your grandmother.\ -The game is [Camica][bmn]. +The game is [Camicia][bmn]. At first it feels like just another friendly match: cards slapped down, laughter across the table, the occasional victorious grin from Nonna. But as the game drags on, something strange happens. From c151e85d52102ae430081afb6d0394da91f63d96 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:51:38 +0200 Subject: [PATCH 26/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index d2811e9fcc..a6b2655dd8 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -51,7 +51,7 @@ Here’s a simple example of input and output. ## Your Task -* Parse the two players’ decks from the input. +* Parse the two players' decks from the input. * Simulate the game following the rules above. * Determine is the final game status is `"finished"` or `"loop"`. From 3f09d791f186a9da0dad41574b91021bf480f10a Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:52:35 +0200 Subject: [PATCH 27/79] Update exercises/camicia/introduction.md Co-authored-by: Isaac Good --- exercises/camicia/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index 05b1318c61..ae6fba8833 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -1,6 +1,6 @@ # Introduction -One rainy afternoon, you sit at the kitchen table playing cards with your grandmother.\ +One rainy afternoon, you sit at the kitchen table playing cards with your grandmother. The game is [Camicia][bmn]. At first it feels like just another friendly match: cards slapped down, laughter across the table, the occasional victorious grin from Nonna. From a2ae162b4266b17417d588d81da232dd107c18e6 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 31 Aug 2025 11:06:46 +0200 Subject: [PATCH 28/79] changed bullet list from * to - as reported in the guidelines --- exercises/camicia/instructions.md | 50 +++++++++++++------------------ 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index a6b2655dd8..e51ec08c38 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -5,26 +5,19 @@ Your program will receive the initial configuration of two players’ decks and ## Rules -* The deck is split between **two players**. +- The deck is split between **two players**. Each player's cards are represented as a string where the leftmost character is the top of the deck. - -* Players take turns placing the **top card** of their deck onto a central pile. - -* If the card is a **number card** (`-` in this scenario), play simply passes to the other player. - -* If the card is a **payment card**, a price needs to be paid: - - * `J` → opponent must pay 1 card - * `Q` → opponent must pay 2 cards - * `K` → opponent must pay 3 cards - * `A` → opponent must pay 4 cards - -* If the player paying a penalty reveals another payment card, that player stops paying the penalty and the other player much then pay the penalty. - -* If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. +- Players take turns placing the **top card** of their deck onto a central pile. +- If the card is a **number card** (`-` in this scenario), play simply passes to the other player. +- If the card is a **payment card**, a price needs to be paid: + - `J` → opponent must pay 1 card + - `Q` → opponent must pay 2 cards + - `K` → opponent must pay 3 cards + - `A` → opponent must pay 4 cards +- If the player paying a penalty reveals another payment card, that player stops paying the penalty and the other player much then pay the penalty. +- If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. That player then starts the next round. - -* The game ends when one player has no more cards. +- The game ends when one player has no more cards. ## Example @@ -44,17 +37,16 @@ Here’s a simple example of input and output. ### Explanation -* Player A only has number cards, so can never defend against a payment card. -* Player B has a long sequence of payment cards: Aces, Kings, Queens, and Jacks. -* Each payment card forces a payment, which Player A cannot counter with a payment card of their own, so Player B repeatedly wins the pile (repeatedly completes a trick). -* In the end, player B captures their opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). +- Player A only has number cards, so can never defend against a payment card. +- Player B has a long sequence of payment cards: Aces, Kings, Queens, and Jacks. +- Each payment card forces a payment, which Player A cannot counter with a payment card of their own, so Player B repeatedly wins the pile (repeatedly completes a trick). +- In the end, player B captures their opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). ## Your Task -* Parse the two players' decks from the input. -* Simulate the game following the rules above. -* Determine is the final game status is `"finished"` or `"loop"`. - - * `"status"`: `"finished"` or `"loop"` - * `"cards"`: total number of cards played throughout the game - * `"tricks"`: number of times the central pile was collected \ No newline at end of file +- Parse the two players' decks from the input. +- Simulate the game following the rules above. +- Determine is the final game status is `"finished"` or `"loop"`. + - `"status"`: `"finished"` or `"loop"` + - `"cards"`: total number of cards played throughout the game + - `"tricks"`: number of times the central pile was collected \ No newline at end of file From 468c80763590ce82d767562fbbc87f469e0fb458 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 31 Aug 2025 11:12:07 +0200 Subject: [PATCH 29/79] fixed EOF --- exercises/camicia/instructions.md | 2 +- exercises/camicia/introduction.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index e51ec08c38..0df1807f7c 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -49,4 +49,4 @@ Here’s a simple example of input and output. - Determine is the final game status is `"finished"` or `"loop"`. - `"status"`: `"finished"` or `"loop"` - `"cards"`: total number of cards played throughout the game - - `"tricks"`: number of times the central pile was collected \ No newline at end of file + - `"tricks"`: number of times the central pile was collected diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index ae6fba8833..12b0b8adc3 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -21,4 +21,4 @@ _Perhaps even long enough to set a new world record?_ And so, armed with nothing but a deck of cards and some algorithmic ingenuity, you decide to investigate... -[bmn]: https://en.wikipedia.org/wiki/Beggar-my-neighbour \ No newline at end of file +[bmn]: https://en.wikipedia.org/wiki/Beggar-my-neighbour From d4cde54d6aa5a3f3120e523f102191677f7c8948 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 31 Aug 2025 11:17:22 +0200 Subject: [PATCH 30/79] changed number card rule --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 0df1807f7c..cb65546c66 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -8,7 +8,7 @@ Your program will receive the initial configuration of two players’ decks and - The deck is split between **two players**. Each player's cards are represented as a string where the leftmost character is the top of the deck. - Players take turns placing the **top card** of their deck onto a central pile. -- If the card is a **number card** (`-` in this scenario), play simply passes to the other player. +- If the card is a **number card** (2-10), play simply passes to the other player. - If the card is a **payment card**, a price needs to be paid: - `J` → opponent must pay 1 card - `Q` → opponent must pay 2 cards From b1c23b70a50166c9712ab1f9b1f52c4f30bc568e Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 31 Aug 2025 21:12:21 +0200 Subject: [PATCH 31/79] replaced - with numbers from 2 to 10 --- exercises/camicia/canonical-data.json | 62 +++++++++++++-------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index 2e41d318a6..45ec4a3b52 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -6,8 +6,8 @@ "description": "easy card combination", "property": "simulateGame", "input": { - "playerA": "--------------------------", - "playerB": "----------AAAAKKKKQQQQJJJJ" + "playerA": "487541039731010682854596528109", + "playerB": "6947223673AAAAKKKKQQQQJJJJ" }, "expected": { "status": "finished", @@ -20,8 +20,8 @@ "description": "easy card combination, inverted decks", "property": "simulateGame", "input": { - "playerA": "----------AAAAKKKKQQQQJJJJ", - "playerB": "--------------------------" + "playerA": "33573210767AAAAKKKKQQQQJJJJ", + "playerB": "51082672492610105484869859349" }, "expected": { "status": "finished", @@ -34,8 +34,8 @@ "description": "mirrored decks", "property": "simulateGame", "input": { - "playerA": "-A-A-K-K-Q-Q-J-J----------", - "playerB": "-A-A-K-K-Q-Q-J-J----------" + "playerA": "2A3A3K4K2Q2Q10J5J610291073969", + "playerB": "6A4A7K4K7Q7Q5J8J45891068385" }, "expected": { "status": "finished", @@ -48,8 +48,8 @@ "description": "opposite decks", "property": "simulateGame", "input": { - "playerA": "-A-A-K-K-Q-Q-J-J----------", - "playerB": "----------J-J-Q-Q-K-K-A-A-" + "playerA": "4A9A4K9K6Q8Q8J10J9846365243", + "playerB": "10732927875J7J10Q10Q3K5K6A2A5" }, "expected": { "status": "finished", @@ -62,8 +62,8 @@ "description": "random decks #1", "property": "simulateGame", "input": { - "playerA": "K---J----AK---J-J---------", - "playerB": "--KAQ-A-Q-----Q-K--A-Q-J--" + "playerA": "K1098J8697AK544J5J435867749", + "playerB": "63KAQ10A2Q8210102Q3K97A3Q5J26" }, "expected": { "status": "finished", @@ -76,8 +76,8 @@ "description": "random decks #2", "property": "simulateGame", "input": { - "playerA": "-A---QJ-----KA--K---K---K-", - "playerB": "----QJA------JA-Q-JQ------" + "playerA": "8A485QJ26297KA810K8109K673K9", + "playerB": "10526QJA955373JA2Q3JQ4104746" }, "expected": { "status": "finished", @@ -90,8 +90,8 @@ "description": "Kleber 1999", "property": "simulateGame", "input": { - "playerA": "---JQ---K-A----A-J-K---QK-", - "playerB": "-J-----------AJQA----K---Q" + "playerA": "489JQ855K2A98510A4J3K692QK7", + "playerB": "10J324104753667AJQA72103K968Q" }, "expected": { "status": "finished", @@ -104,8 +104,8 @@ "description": "Collins 2006", "property": "simulateGame", "input": { - "playerA": "A-QK------Q----KA-----J---", - "playerB": "-JAK----A--Q----J---QJ--K-" + "playerA": "A8QK9103742Q32109KA87745J9210", + "playerB": "4JAK8566A65Q46108J257QJ33K9" }, "expected": { "status": "finished", @@ -118,8 +118,8 @@ "description": "Mann and Wu 2007", "property": "simulateGame", "input": { - "playerA": "K-KK----K-A-----JAA--Q--J-", - "playerB": "---Q---Q-J-----J------AQ--" + "playerA": "K2KK33610K6A25579JAA34Q48J6", + "playerB": "452Q799Q7J9810310J4108687AQ52" }, "expected": { "status": "finished", @@ -132,8 +132,8 @@ "description": "Nessler 2012", "property": "simulateGame", "input": { - "playerA": "----Q------A--K--A-A--QJK-", - "playerB": "-Q--J--J---QK---K----JA---" + "playerA": "10367Q298284A106K210A5A24QJK4", + "playerB": "10Q46J93J933QK595K6578JA787" }, "expected": { "status": "finished", @@ -146,8 +146,8 @@ "description": "Anderson 2013", "property": "simulateGame", "input": { - "playerA": "--A-Q--J--J---Q--AJ-K---K-", - "playerB": "-J-------Q------A--A--QKK-" + "playerA": "67A3Q35J32J745Q105AJ2K899K3", + "playerB": "4J69851079Q27108410A64A68QKK2" }, "expected": { "status": "finished", @@ -160,8 +160,8 @@ "description": "Rucklidge 2014", "property": "simulateGame", "input": { - "playerA": "-J------Q------AAA-----QQ-", - "playerB": "K----JA-----------KQ-K-JJK" + "playerA": "8J294458Q393628AAA94725QQ3", + "playerB": "K71063JA7655810910427KQ10K6JJK" }, "expected": { "status": "finished", @@ -174,8 +174,8 @@ "description": "Nessler 2021", "property": "simulateGame", "input": { - "playerA": "----K---A--Q-A--JJA------J", - "playerB": "-----KK---------A-JK-Q-Q-Q" + "playerA": "7234K9610A89Q7A48JJA432566J", + "playerB": "310898KK255764357A9JK2Q10Q10Q" }, "expected": { "status": "finished", @@ -188,8 +188,8 @@ "description": "Nessler 2022", "property": "simulateGame", "input": { - "playerA": "---AJ--Q---------QAKQJJ-QK", - "playerB": "-----A----KJ-K--------A---" + "playerA": "21010AJ38Q2555924310QAKQJJ9QK", + "playerB": "107636A8943KJ6K49785782A746" }, "expected": { "status": "finished", @@ -202,8 +202,8 @@ "description": "Casella 2024, first infinite game found", "property": "simulateGame", "input": { - "playerA": "---K---Q-KQAJ-----AAJ--J--", - "playerB": "----------Q----KQ-J-----KA" + "playerA": "284K523Q6KQAJ35983AAJ44J75", + "playerB": "7786101061072Q6324KQ10J59899KA" }, "expected": { "status": "loop", @@ -212,4 +212,4 @@ } } ] -} \ No newline at end of file +} From 6b01ea9ed53c3bbb14cc5aeb9667f8b1322bf249 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 31 Aug 2025 21:56:43 +0200 Subject: [PATCH 32/79] improved explanation of tricks --- exercises/camicia/instructions.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index cb65546c66..29d4e5ed20 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -17,7 +17,13 @@ Your program will receive the initial configuration of two players’ decks and - If the player paying a penalty reveals another payment card, that player stops paying the penalty and the other player much then pay the penalty. - If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. That player then starts the next round. -- The game ends when one player has no more cards. +- The moment when the winner of the round collects the cards from the central pile is called a **trick**. +- A **trick** can occur in several ways: + - When a player finishes paying their penalty → the game continues + - When a player runs out of cards while paying a penalty → the game ends + - When a player can no longer place a card in the central pile → the game ends +- The game **ends** when one player can no longer respond by playing a card, in general. +- The game **enters a loop** as soon as decks identical to previous ones are played during the game, ***not*** counting number cards! ## Example From e93651c500154b362823638fd3b7729bc0e509c1 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 31 Aug 2025 21:58:15 +0200 Subject: [PATCH 33/79] fix typo --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 29d4e5ed20..43fead2443 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -23,7 +23,7 @@ Your program will receive the initial configuration of two players’ decks and - When a player runs out of cards while paying a penalty → the game ends - When a player can no longer place a card in the central pile → the game ends - The game **ends** when one player can no longer respond by playing a card, in general. -- The game **enters a loop** as soon as decks identical to previous ones are played during the game, ***not*** counting number cards! +- The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! ## Example From bb0f154824609d71c1994a7dc93423da67a965c3 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 31 Aug 2025 22:02:41 +0200 Subject: [PATCH 34/79] fix lint json --- exercises/camicia/canonical-data.json | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index 45ec4a3b52..b79b9d4678 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -11,7 +11,7 @@ }, "expected": { "status": "finished", - "cards": 40, + "cards": 40, "tricks": 4 } }, @@ -25,7 +25,7 @@ }, "expected": { "status": "finished", - "cards": 40, + "cards": 40, "tricks": 4 } }, @@ -39,7 +39,7 @@ }, "expected": { "status": "finished", - "cards": 59, + "cards": 59, "tricks": 4 } }, @@ -53,7 +53,7 @@ }, "expected": { "status": "finished", - "cards": 151, + "cards": 151, "tricks": 21 } }, @@ -67,7 +67,7 @@ }, "expected": { "status": "finished", - "cards": 542, + "cards": 542, "tricks": 76 } }, @@ -81,7 +81,7 @@ }, "expected": { "status": "finished", - "cards": 327, + "cards": 327, "tricks": 42 } }, @@ -95,7 +95,7 @@ }, "expected": { "status": "finished", - "cards": 5790, + "cards": 5790, "tricks": 805 } }, @@ -109,7 +109,7 @@ }, "expected": { "status": "finished", - "cards": 6913, + "cards": 6913, "tricks": 960 } }, @@ -123,7 +123,7 @@ }, "expected": { "status": "finished", - "cards": 7157, + "cards": 7157, "tricks": 1007 } }, @@ -137,7 +137,7 @@ }, "expected": { "status": "finished", - "cards": 7207, + "cards": 7207, "tricks": 1015 } }, @@ -151,7 +151,7 @@ }, "expected": { "status": "finished", - "cards": 7225, + "cards": 7225, "tricks": 1016 } }, @@ -179,7 +179,7 @@ }, "expected": { "status": "finished", - "cards": 7972, + "cards": 7972, "tricks": 1106 } }, @@ -193,7 +193,7 @@ }, "expected": { "status": "finished", - "cards": 8344, + "cards": 8344, "tricks": 1164 } }, @@ -207,7 +207,7 @@ }, "expected": { "status": "loop", - "cards": 474, + "cards": 474, "tricks": 66 } } From c1c04e7eda8db80c234747629e4a7dcf44ffc0c3 Mon Sep 17 00:00:00 2001 From: Isaac Good Date: Sun, 31 Aug 2025 16:04:22 -0700 Subject: [PATCH 35/79] Remove carriage returns from canonical-data.json --- exercises/camicia/canonical-data.json | 430 +++++++++++++------------- 1 file changed, 215 insertions(+), 215 deletions(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index b79b9d4678..686c7773eb 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -1,215 +1,215 @@ -{ - "exercise": "camicia", - "cases": [ - { - "uuid": "dca32c31-11ed-49f6-b078-79ab912c1f7b", - "description": "easy card combination", - "property": "simulateGame", - "input": { - "playerA": "487541039731010682854596528109", - "playerB": "6947223673AAAAKKKKQQQQJJJJ" - }, - "expected": { - "status": "finished", - "cards": 40, - "tricks": 4 - } - }, - { - "uuid": "1f8488d0-48d3-45ae-b819-59cedad0a5f4", - "description": "easy card combination, inverted decks", - "property": "simulateGame", - "input": { - "playerA": "33573210767AAAAKKKKQQQQJJJJ", - "playerB": "51082672492610105484869859349" - }, - "expected": { - "status": "finished", - "cards": 40, - "tricks": 4 - } - }, - { - "uuid": "98878d35-623a-4d05-b81a-7bdc569eb88d", - "description": "mirrored decks", - "property": "simulateGame", - "input": { - "playerA": "2A3A3K4K2Q2Q10J5J610291073969", - "playerB": "6A4A7K4K7Q7Q5J8J45891068385" - }, - "expected": { - "status": "finished", - "cards": 59, - "tricks": 4 - } - }, - { - "uuid": "3e0ba597-ca10-484b-87a3-31a7df7d6da3", - "description": "opposite decks", - "property": "simulateGame", - "input": { - "playerA": "4A9A4K9K6Q8Q8J10J9846365243", - "playerB": "10732927875J7J10Q10Q3K5K6A2A5" - }, - "expected": { - "status": "finished", - "cards": 151, - "tricks": 21 - } - }, - { - "uuid": "92334ddb-aaa7-47fa-ab36-e928a8a6a67c", - "description": "random decks #1", - "property": "simulateGame", - "input": { - "playerA": "K1098J8697AK544J5J435867749", - "playerB": "63KAQ10A2Q8210102Q3K97A3Q5J26" - }, - "expected": { - "status": "finished", - "cards": 542, - "tricks": 76 - } - }, - { - "uuid": "30477523-9651-4860-84a3-e1ac461bb7fa", - "description": "random decks #2", - "property": "simulateGame", - "input": { - "playerA": "8A485QJ26297KA810K8109K673K9", - "playerB": "10526QJA955373JA2Q3JQ4104746" - }, - "expected": { - "status": "finished", - "cards": 327, - "tricks": 42 - } - }, - { - "uuid": "20967de8-9e94-4e0e-9010-14bc1c157432", - "description": "Kleber 1999", - "property": "simulateGame", - "input": { - "playerA": "489JQ855K2A98510A4J3K692QK7", - "playerB": "10J324104753667AJQA72103K968Q" - }, - "expected": { - "status": "finished", - "cards": 5790, - "tricks": 805 - } - }, - { - "uuid": "9f2fdfe8-27f3-4323-816d-6bce98a9c6f7", - "description": "Collins 2006", - "property": "simulateGame", - "input": { - "playerA": "A8QK9103742Q32109KA87745J9210", - "playerB": "4JAK8566A65Q46108J257QJ33K9" - }, - "expected": { - "status": "finished", - "cards": 6913, - "tricks": 960 - } - }, - { - "uuid": "c90b6f8d-7013-49f3-b5cb-14ea006cca1d", - "description": "Mann and Wu 2007", - "property": "simulateGame", - "input": { - "playerA": "K2KK33610K6A25579JAA34Q48J6", - "playerB": "452Q799Q7J9810310J4108687AQ52" - }, - "expected": { - "status": "finished", - "cards": 7157, - "tricks": 1007 - } - }, - { - "uuid": "a3f1fbc5-1d0b-499a-92a5-22932dfc6bc8", - "description": "Nessler 2012", - "property": "simulateGame", - "input": { - "playerA": "10367Q298284A106K210A5A24QJK4", - "playerB": "10Q46J93J933QK595K6578JA787" - }, - "expected": { - "status": "finished", - "cards": 7207, - "tricks": 1015 - } - }, - { - "uuid": "9cefb1ba-e6d1-4ab7-9d8f-76d8e0976d5f", - "description": "Anderson 2013", - "property": "simulateGame", - "input": { - "playerA": "67A3Q35J32J745Q105AJ2K899K3", - "playerB": "4J69851079Q27108410A64A68QKK2" - }, - "expected": { - "status": "finished", - "cards": 7225, - "tricks": 1016 - } - }, - { - "uuid": "d37c0318-5be6-48d0-ab72-a7aaaff86179", - "description": "Rucklidge 2014", - "property": "simulateGame", - "input": { - "playerA": "8J294458Q393628AAA94725QQ3", - "playerB": "K71063JA7655810910427KQ10K6JJK" - }, - "expected": { - "status": "finished", - "cards": 7959, - "tricks": 1122 - } - }, - { - "uuid": "4305e479-ba87-432f-8a29-cd2bd75d2f05", - "description": "Nessler 2021", - "property": "simulateGame", - "input": { - "playerA": "7234K9610A89Q7A48JJA432566J", - "playerB": "310898KK255764357A9JK2Q10Q10Q" - }, - "expected": { - "status": "finished", - "cards": 7972, - "tricks": 1106 - } - }, - { - "uuid": "252f5cc3-b86d-4251-87ce-f920b7a6a559", - "description": "Nessler 2022", - "property": "simulateGame", - "input": { - "playerA": "21010AJ38Q2555924310QAKQJJ9QK", - "playerB": "107636A8943KJ6K49785782A746" - }, - "expected": { - "status": "finished", - "cards": 8344, - "tricks": 1164 - } - }, - { - "uuid": "b9efcfa4-842f-4542-8112-8389c714d958", - "description": "Casella 2024, first infinite game found", - "property": "simulateGame", - "input": { - "playerA": "284K523Q6KQAJ35983AAJ44J75", - "playerB": "7786101061072Q6324KQ10J59899KA" - }, - "expected": { - "status": "loop", - "cards": 474, - "tricks": 66 - } - } - ] -} +{ + "exercise": "camicia", + "cases": [ + { + "uuid": "dca32c31-11ed-49f6-b078-79ab912c1f7b", + "description": "easy card combination", + "property": "simulateGame", + "input": { + "playerA": "487541039731010682854596528109", + "playerB": "6947223673AAAAKKKKQQQQJJJJ" + }, + "expected": { + "status": "finished", + "cards": 40, + "tricks": 4 + } + }, + { + "uuid": "1f8488d0-48d3-45ae-b819-59cedad0a5f4", + "description": "easy card combination, inverted decks", + "property": "simulateGame", + "input": { + "playerA": "33573210767AAAAKKKKQQQQJJJJ", + "playerB": "51082672492610105484869859349" + }, + "expected": { + "status": "finished", + "cards": 40, + "tricks": 4 + } + }, + { + "uuid": "98878d35-623a-4d05-b81a-7bdc569eb88d", + "description": "mirrored decks", + "property": "simulateGame", + "input": { + "playerA": "2A3A3K4K2Q2Q10J5J610291073969", + "playerB": "6A4A7K4K7Q7Q5J8J45891068385" + }, + "expected": { + "status": "finished", + "cards": 59, + "tricks": 4 + } + }, + { + "uuid": "3e0ba597-ca10-484b-87a3-31a7df7d6da3", + "description": "opposite decks", + "property": "simulateGame", + "input": { + "playerA": "4A9A4K9K6Q8Q8J10J9846365243", + "playerB": "10732927875J7J10Q10Q3K5K6A2A5" + }, + "expected": { + "status": "finished", + "cards": 151, + "tricks": 21 + } + }, + { + "uuid": "92334ddb-aaa7-47fa-ab36-e928a8a6a67c", + "description": "random decks #1", + "property": "simulateGame", + "input": { + "playerA": "K1098J8697AK544J5J435867749", + "playerB": "63KAQ10A2Q8210102Q3K97A3Q5J26" + }, + "expected": { + "status": "finished", + "cards": 542, + "tricks": 76 + } + }, + { + "uuid": "30477523-9651-4860-84a3-e1ac461bb7fa", + "description": "random decks #2", + "property": "simulateGame", + "input": { + "playerA": "8A485QJ26297KA810K8109K673K9", + "playerB": "10526QJA955373JA2Q3JQ4104746" + }, + "expected": { + "status": "finished", + "cards": 327, + "tricks": 42 + } + }, + { + "uuid": "20967de8-9e94-4e0e-9010-14bc1c157432", + "description": "Kleber 1999", + "property": "simulateGame", + "input": { + "playerA": "489JQ855K2A98510A4J3K692QK7", + "playerB": "10J324104753667AJQA72103K968Q" + }, + "expected": { + "status": "finished", + "cards": 5790, + "tricks": 805 + } + }, + { + "uuid": "9f2fdfe8-27f3-4323-816d-6bce98a9c6f7", + "description": "Collins 2006", + "property": "simulateGame", + "input": { + "playerA": "A8QK9103742Q32109KA87745J9210", + "playerB": "4JAK8566A65Q46108J257QJ33K9" + }, + "expected": { + "status": "finished", + "cards": 6913, + "tricks": 960 + } + }, + { + "uuid": "c90b6f8d-7013-49f3-b5cb-14ea006cca1d", + "description": "Mann and Wu 2007", + "property": "simulateGame", + "input": { + "playerA": "K2KK33610K6A25579JAA34Q48J6", + "playerB": "452Q799Q7J9810310J4108687AQ52" + }, + "expected": { + "status": "finished", + "cards": 7157, + "tricks": 1007 + } + }, + { + "uuid": "a3f1fbc5-1d0b-499a-92a5-22932dfc6bc8", + "description": "Nessler 2012", + "property": "simulateGame", + "input": { + "playerA": "10367Q298284A106K210A5A24QJK4", + "playerB": "10Q46J93J933QK595K6578JA787" + }, + "expected": { + "status": "finished", + "cards": 7207, + "tricks": 1015 + } + }, + { + "uuid": "9cefb1ba-e6d1-4ab7-9d8f-76d8e0976d5f", + "description": "Anderson 2013", + "property": "simulateGame", + "input": { + "playerA": "67A3Q35J32J745Q105AJ2K899K3", + "playerB": "4J69851079Q27108410A64A68QKK2" + }, + "expected": { + "status": "finished", + "cards": 7225, + "tricks": 1016 + } + }, + { + "uuid": "d37c0318-5be6-48d0-ab72-a7aaaff86179", + "description": "Rucklidge 2014", + "property": "simulateGame", + "input": { + "playerA": "8J294458Q393628AAA94725QQ3", + "playerB": "K71063JA7655810910427KQ10K6JJK" + }, + "expected": { + "status": "finished", + "cards": 7959, + "tricks": 1122 + } + }, + { + "uuid": "4305e479-ba87-432f-8a29-cd2bd75d2f05", + "description": "Nessler 2021", + "property": "simulateGame", + "input": { + "playerA": "7234K9610A89Q7A48JJA432566J", + "playerB": "310898KK255764357A9JK2Q10Q10Q" + }, + "expected": { + "status": "finished", + "cards": 7972, + "tricks": 1106 + } + }, + { + "uuid": "252f5cc3-b86d-4251-87ce-f920b7a6a559", + "description": "Nessler 2022", + "property": "simulateGame", + "input": { + "playerA": "21010AJ38Q2555924310QAKQJJ9QK", + "playerB": "107636A8943KJ6K49785782A746" + }, + "expected": { + "status": "finished", + "cards": 8344, + "tricks": 1164 + } + }, + { + "uuid": "b9efcfa4-842f-4542-8112-8389c714d958", + "description": "Casella 2024, first infinite game found", + "property": "simulateGame", + "input": { + "playerA": "284K523Q6KQAJ35983AAJ44J75", + "playerB": "7786101061072Q6324KQ10J59899KA" + }, + "expected": { + "status": "loop", + "cards": 474, + "tricks": 66 + } + } + ] +} From 385fc5a25062d249b4b29f50a2eded9b13876790 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Mon, 1 Sep 2025 01:45:00 +0200 Subject: [PATCH 36/79] added new basic tests --- exercises/camicia/canonical-data.json | 182 ++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index 686c7773eb..81947be599 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -1,6 +1,188 @@ { "exercise": "camicia", "cases": [ + { + "uuid": "0b7f737c-3ecd-4a55-b34d-e65c62a85c28", + "description": "two cards, one trick", + "property": "simulateGame", + "input": { + "playerA": "2", + "playerB": "3" + }, + "expected": { + "status": "finished", + "cards": 2, + "tricks": 1 + } + }, + { + "uuid": "27c19d75-53a5-48e5-b33b-232c3884d4f3", + "description": "three cards, one trick", + "property": "simulateGame", + "input": { + "playerA": "24", + "playerB": "3" + }, + "expected": { + "status": "finished", + "cards": 3, + "tricks": 1 + } + }, + { + "uuid": "9b02dd49-efaf-4b71-adca-a05c18a7c5b0", + "description": "four cards, one trick", + "property": "simulateGame", + "input": { + "playerA": "24", + "playerB": "356" + }, + "expected": { + "status": "finished", + "cards": 4, + "tricks": 1 + } + }, + { + "uuid": "fa3f4479-466a-4734-a001-ab79bfe27260", + "description": "the ace reigns supreme", + "property": "simulateGame", + "input": { + "playerA": "2A", + "playerB": "34567" + }, + "expected": { + "status": "finished", + "cards": 7, + "tricks": 1 + } + }, + { + "uuid": "07629689-f589-4f54-a6d1-8ce22776ce72", + "description": "the king beats ace", + "property": "simulateGame", + "input": { + "playerA": "2A", + "playerB": "3456K" + }, + "expected": { + "status": "finished", + "cards": 7, + "tricks": 1 + } + }, + { + "uuid": "54d4a1c5-76fb-4d1e-8358-0e0296ac0601", + "description": "the queen seduces the king", + "property": "simulateGame", + "input": { + "playerA": "2A78Q", + "playerB": "3456K" + }, + "expected": { + "status": "finished", + "cards": 10, + "tricks": 1 + } + }, + { + "uuid": "c875500c-ff3d-47a4-bd1e-b60b90da80aa", + "description": "the jack betrays the queen", + "property": "simulateGame", + "input": { + "playerA": "2A78Q", + "playerB": "3456K9J" + }, + "expected": { + "status": "finished", + "cards": 12, + "tricks": 1 + } + }, + { + "uuid": "436875da-96ca-4149-be22-0b78173b8125", + "description": "the 10 just wants to put on a show", + "property": "simulateGame", + "input": { + "playerA": "2A78Q10", + "playerB": "3456K9J" + }, + "expected": { + "status": "finished", + "cards": 13, + "tricks": 1 + } + }, + { + "uuid": "2795dc21-0a2a-4c38-87c2-5a42e1ff15eb", + "description": "the story is starting to get a bit complicated", + "property": "simulateGame", + "input": { + "playerA": "266J4KQ10KJQ23K56QQAA69KA8K2A9AQ4KKK35K8Q3Q7JKJ9J33KKQAK710AQ710J45J910QJJK610J6QJ5JQQ838A269K7JKK8KQ610J10JQJ1038KA69K2AA10J6A4JAJJ62J3K259J96KA5QJ2QKA3KJK256QJQQJ2J9Q77AQ7QJKJA778Q10J10JJ92A2", + "playerB": "7210K82J9A56JQ6K65A4Q7J7102Q822KJA55A4Q6QK108Q210JAQ8QQJJAA910JK4Q1010JK102J7AKKJAJ108KA7QQJ3Q4A3AQQQ54KJ10AQJ6JA10A583K59Q877J7QQQA789AQAK8AAJ848KJA10Q8J8610QJJAAJ5Q6JKQ8K4QQ6JK47JJ99AQQKA65K" + }, + "expected": { + "status": "finished", + "cards": 361, + "tricks": 1 + } + }, + { + "uuid": "6999dfac-3fdc-41e2-b64b-38f4be228712", + "description": "two tricks", + "property": "simulateGame", + "input": { + "playerA": "J", + "playerB": "3J" + }, + "expected": { + "status": "finished", + "cards": 5, + "tricks": 2 + } + }, + { + "uuid": "83dcd4f3-e089-4d54-855a-73f5346543a3", + "description": "more tricks", + "property": "simulateGame", + "input": { + "playerA": "J24", + "playerB": "3JA" + }, + "expected": { + "status": "finished", + "cards": 12, + "tricks": 4 + } + }, + { + "uuid": "5be39bb6-1b34-4ce6-a1cd-0fcc142bb272", + "description": "simple loop with decks of 3 cards", + "property": "simulateGame", + "input": { + "playerA": "J23", + "playerB": "4J5" + }, + "expected": { + "status": "loop", + "cards": 8, + "tricks": 3 + } + }, + { + "uuid": "3107985a-f43e-486a-9ce8-db51547a9941", + "description": "simple loop with decks of 4 cards", + "property": "simulateGame", + "input": { + "playerA": "23J6", + "playerB": "K5J7" + }, + "expected": { + "status": "loop", + "cards": 16, + "tricks": 4 + } + }, { "uuid": "dca32c31-11ed-49f6-b078-79ab912c1f7b", "description": "easy card combination", From 9d8dd231f18759c55f4a07e0e6e42231c094f9df Mon Sep 17 00:00:00 2001 From: FraSanga Date: Mon, 1 Sep 2025 02:38:04 +0200 Subject: [PATCH 37/79] added new examples in instructions --- exercises/camicia/instructions.md | 50 ++++++++++++++++++------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 43fead2443..c0cc0972c1 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -25,34 +25,44 @@ Your program will receive the initial configuration of two players’ decks and - The game **ends** when one player can no longer respond by playing a card, in general. - The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! -## Example - -Here’s a simple example of input and output. - -```json -"input": { - "playerA": "--------------------------", - "playerB": "----------AAAAKKKKQQQQJJJJ" -}, -"output": { - "status": "finished", - "cards": 40, - "tricks": 4 -} +## Examples + +A small example of a match that ends: +``` +Player A: "2A78Q10" +Player B: "3456K9J" +Pile: 2 → 3 → A → 4 → 5 → 6 → K → 7 → 8 → Q → 9 → J → 10 +(status: "finished", cards: 13, tricks: 1) +``` + +A small example of a match that goes into a loop: ``` +Player A: "J23" +Player B: "4J5" +Pile: J → 4 +(cards: 2, tricks: 1) + +Player A: "23J4" +Player B: "J5" +Pile: 2 → J → 3 +(cards: 5, tricks: 2) -### Explanation +Player A: "J4" +Player B: "52J3" +Pile: 5 → J → 2 +(cards: 8, tricks: 3) -- Player A only has number cards, so can never defend against a payment card. -- Player B has a long sequence of payment cards: Aces, Kings, Queens, and Jacks. -- Each payment card forces a payment, which Player A cannot counter with a payment card of their own, so Player B repeatedly wins the pile (repeatedly completes a trick). -- In the end, player B captures their opponent's entire deck by playing 40 cards in just 4 "tricks" (turns in which a deck is collected). +Player A: "45J2" +Player B: "J3" +Payment card configuration already viewed! +(status: "loop", cards: 8, tricks: 3) +``` ## Your Task - Parse the two players' decks from the input. - Simulate the game following the rules above. -- Determine is the final game status is `"finished"` or `"loop"`. +- Determine the following information regarding the game: - `"status"`: `"finished"` or `"loop"` - `"cards"`: total number of cards played throughout the game - `"tricks"`: number of times the central pile was collected From 9c22029f7527bf318b6450e1b56882dc82c1231d Mon Sep 17 00:00:00 2001 From: FraSanga Date: Mon, 1 Sep 2025 02:43:07 +0200 Subject: [PATCH 38/79] fixed markdown CI --- exercises/camicia/instructions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index c0cc0972c1..07020b2fdb 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -28,6 +28,7 @@ Your program will receive the initial configuration of two players’ decks and ## Examples A small example of a match that ends: + ``` Player A: "2A78Q10" Player B: "3456K9J" @@ -36,6 +37,7 @@ Pile: 2 → 3 → A → 4 → 5 → 6 → K → 7 → 8 → Q → 9 → J → 10 ``` A small example of a match that goes into a loop: + ``` Player A: "J23" Player B: "4J5" From 6379ac033ea37db166b61f7b509a7942d133d301 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Mon, 1 Sep 2025 02:46:36 +0200 Subject: [PATCH 39/79] fixed markdown CI MD040 --- exercises/camicia/instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 07020b2fdb..a9ecbf434f 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -29,7 +29,7 @@ Your program will receive the initial configuration of two players’ decks and A small example of a match that ends: -``` +```text Player A: "2A78Q10" Player B: "3456K9J" Pile: 2 → 3 → A → 4 → 5 → 6 → K → 7 → 8 → Q → 9 → J → 10 @@ -38,7 +38,7 @@ Pile: 2 → 3 → A → 4 → 5 → 6 → K → 7 → 8 → Q → 9 → J → 10 A small example of a match that goes into a loop: -``` +```text Player A: "J23" Player B: "4J5" Pile: J → 4 From 3484c45cd810523e1afa0548430eb533c956d502 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Mon, 1 Sep 2025 03:12:56 +0200 Subject: [PATCH 40/79] added admonitions for edge cases & to explore advanced topic --- exercises/camicia/instructions.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index a9ecbf434f..63128a5bc4 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -60,6 +60,10 @@ Payment card configuration already viewed! (status: "loop", cards: 8, tricks: 3) ``` +~~~~exercism/caution +When players are at the beginning of one of the rounds and have not yet played a payment card, if one of them runs out of cards, the opposing player must play another card before collecting the cards from the central pile and completing the trick. +~~~~ + ## Your Task - Parse the two players' decks from the input. @@ -68,3 +72,8 @@ Payment card configuration already viewed! - `"status"`: `"finished"` or `"loop"` - `"cards"`: total number of cards played throughout the game - `"tricks"`: number of times the central pile was collected + +~~~~exercism/advanced +For those who want to take on a more exciting challenge, the hunt for other records for the longest game with an end is still open. +There are 653,534,134,886,878,245,000 (approximately 654 quintillion) possibilities, and we haven't calculated them all yet! +~~~~ From 527b4a89814a3a2629847038d4ba4cfc0e4b84af Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:09:07 +0200 Subject: [PATCH 41/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 63128a5bc4..c8c942edff 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -1,7 +1,7 @@ # Instructions In this exercise, you will simulate the classic card game **Camicia**. -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). +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). ## Rules From 320180dc3119df8ef541d1189d01e0923874daaf Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:09:42 +0200 Subject: [PATCH 42/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index c8c942edff..c0c69b8a84 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -14,7 +14,8 @@ Your program will receive the initial configuration of two players' decks and mu - `Q` → opponent must pay 2 cards - `K` → opponent must pay 3 cards - `A` → opponent must pay 4 cards -- If the player paying a penalty reveals another payment card, that player stops paying the penalty and the other player much then pay the penalty. +- If the player paying a penalty reveals another payment card, that player stops paying the penalty. + The other player must then pay a penalty based on the new payment card. - If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. That player then starts the next round. - The moment when the winner of the round collects the cards from the central pile is called a **trick**. From a11753e0c46b1cd61a8d0ddcd1f01093cdfcf0c7 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:10:13 +0200 Subject: [PATCH 43/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index c0c69b8a84..997772ea69 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -19,10 +19,9 @@ Your program will receive the initial configuration of two players' decks and mu - If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. That player then starts the next round. - The moment when the winner of the round collects the cards from the central pile is called a **trick**. -- A **trick** can occur in several ways: - - When a player finishes paying their penalty → the game continues - - When a player runs out of cards while paying a penalty → the game ends - - When a player can no longer place a card in the central pile → the game ends +- A **trick** can occur in two ways: + - When a player finishes paying their penalty. + - When a player runs out of cards, either at the start of their turn or while paying a penalty. - The game **ends** when one player can no longer respond by playing a card, in general. - The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! From 7af95522fd25057f7910936352fbfc5bd3ae0a56 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:11:10 +0200 Subject: [PATCH 44/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 997772ea69..1d4c236f1f 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -22,7 +22,8 @@ Your program will receive the initial configuration of two players' decks and mu - A **trick** can occur in two ways: - When a player finishes paying their penalty. - When a player runs out of cards, either at the start of their turn or while paying a penalty. -- The game **ends** when one player can no longer respond by playing a card, in general. +- The game **ends** when one player can no longer play a card. + This can occur at the start of a turn or while paying a penalty. - The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! ## Examples From 24b2a6a035562ee5d1d87f2c5c0427688e23d085 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:11:34 +0200 Subject: [PATCH 45/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 1d4c236f1f..2374eb480f 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -9,7 +9,7 @@ Your program will receive the initial configuration of two players' decks and mu Each player's cards are represented as a string where the leftmost character is the top of the deck. - Players take turns placing the **top card** of their deck onto a central pile. - If the card is a **number card** (2-10), play simply passes to the other player. -- If the card is a **payment card**, a price needs to be paid: +- If the card is a **payment card**, a penalty must be paid: - `J` → opponent must pay 1 card - `Q` → opponent must pay 2 cards - `K` → opponent must pay 3 cards From 887d8a6b83f802bb33a5a3437924955047c0029e Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:17:56 +0200 Subject: [PATCH 46/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 2374eb480f..db8460e194 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -37,7 +37,7 @@ Pile: 2 → 3 → A → 4 → 5 → 6 → K → 7 → 8 → Q → 9 → J → 10 (status: "finished", cards: 13, tricks: 1) ``` -A small example of a match that goes into a loop: +This is a small example of a match that loops. ```text Player A: "J23" From a01a403cf1198f1e7c725a7124c075fe8decac59 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:20:25 +0200 Subject: [PATCH 47/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index db8460e194..caa3934b4f 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -7,7 +7,8 @@ Your program will receive the initial configuration of two players' decks and mu - The deck is split between **two players**. Each player's cards are represented as a string where the leftmost character is the top of the deck. -- Players take turns placing the **top card** of their deck onto a central pile. +- A round consists of both players taking a turn. +- Players take a turn by placing the **top card** of their deck onto a central pile. - If the card is a **number card** (2-10), play simply passes to the other player. - If the card is a **payment card**, a penalty must be paid: - `J` → opponent must pay 1 card From 031ce053c88d020f5d26b9c1239bbe4ba5be9dbf Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:22:16 +0200 Subject: [PATCH 48/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index caa3934b4f..c941210fb2 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -71,9 +71,9 @@ When players are at the beginning of one of the rounds and have not yet played a - Parse the two players' decks from the input. - Simulate the game following the rules above. - Determine the following information regarding the game: - - `"status"`: `"finished"` or `"loop"` - - `"cards"`: total number of cards played throughout the game - - `"tricks"`: number of times the central pile was collected + - `status`: `"finished"` or `"loop"` + - `cards`: total number of cards played throughout the game + - `tricks`: number of times the central pile was collected ~~~~exercism/advanced For those who want to take on a more exciting challenge, the hunt for other records for the longest game with an end is still open. From 6fe5effc5bf8082dfb83ddc6c4a41264d8325d36 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:22:40 +0200 Subject: [PATCH 49/79] Update exercises/camicia/introduction.md Co-authored-by: Isaac Good --- exercises/camicia/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index 12b0b8adc3..ed987b4277 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -12,7 +12,7 @@ You start to wonder. _Will this game ever finish? Or could we keep playing forever?_ -Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn’t just bad luck. +Later, driven by curiosity, you search online and to your surprise you discover that what happened wasn't just bad luck. You and your grandmother may have stumbled upon one of the longest possible sequences! Suddenly, you're hooked. What began as a casual game has turned into a quest: _how long can such a game really last?_ From 8de18f18a9e92c68b1a7d294b4e09e915fd2d22c Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 22:20:03 +0200 Subject: [PATCH 50/79] Update exercises/camicia/introduction.md Co-authored-by: Isaac Good --- exercises/camicia/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index ed987b4277..b0f6e951bd 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -1,7 +1,7 @@ # Introduction One rainy afternoon, you sit at the kitchen table playing cards with your grandmother. -The game is [Camicia][bmn]. +The game is her take on [Camicia][bmn]. At first it feels like just another friendly match: cards slapped down, laughter across the table, the occasional victorious grin from Nonna. But as the game drags on, something strange happens. From 5dfdeade09ecc69826cbfd6c45ec9ee2590fc4f9 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 1 Sep 2025 22:20:14 +0200 Subject: [PATCH 51/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index c941210fb2..5049a998f9 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -1,6 +1,6 @@ # Instructions -In this exercise, you will simulate the classic card game **Camicia**. +In this exercise, you will simulate a game very similar to the classic card game **Camicia**. 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). ## Rules From 9714913df9d674226f173182ddd8eb3042efc2a5 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Mon, 1 Sep 2025 22:22:34 +0200 Subject: [PATCH 52/79] removed caution note --- exercises/camicia/instructions.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 5049a998f9..5d531936de 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -62,10 +62,6 @@ Payment card configuration already viewed! (status: "loop", cards: 8, tricks: 3) ``` -~~~~exercism/caution -When players are at the beginning of one of the rounds and have not yet played a payment card, if one of them runs out of cards, the opposing player must play another card before collecting the cards from the central pile and completing the trick. -~~~~ - ## Your Task - Parse the two players' decks from the input. From 8ce43e1892e4412449a27ea1d45e986affbe0507 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:35:22 +0200 Subject: [PATCH 53/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 5d531936de..dad3387d48 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -29,7 +29,7 @@ Your program will receive the initial configuration of two players' decks and mu ## Examples -A small example of a match that ends: +A small example of a match that ends. ```text Player A: "2A78Q10" From 4ec0c043e094b7a37aaea20fc62e1ce3190d03b8 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Tue, 2 Sep 2025 09:28:55 +0200 Subject: [PATCH 54/79] Update game rules for clarity on rounds and turns --- exercises/camicia/instructions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index dad3387d48..cc27649829 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -7,7 +7,7 @@ Your program will receive the initial configuration of two players' decks and mu - The deck is split between **two players**. Each player's cards are represented as a string where the leftmost character is the top of the deck. -- A round consists of both players taking a turn. +- A round consists of both players playing at least one card/turn. - Players take a turn by placing the **top card** of their deck onto a central pile. - If the card is a **number card** (2-10), play simply passes to the other player. - If the card is a **payment card**, a penalty must be paid: @@ -22,9 +22,9 @@ Your program will receive the initial configuration of two players' decks and mu - The moment when the winner of the round collects the cards from the central pile is called a **trick**. - A **trick** can occur in two ways: - When a player finishes paying their penalty. - - When a player runs out of cards, either at the start of their turn or while paying a penalty. + - When a player runs out of cards, either at the start of their round or while paying a penalty. - The game **ends** when one player can no longer play a card. - This can occur at the start of a turn or while paying a penalty. + This can occur at the start of a round or while paying a penalty. - The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! ## Examples From 4a94ae3dde30d4fd8d2c6ebfe57766821f3163ef Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Wed, 3 Sep 2025 19:10:40 +0200 Subject: [PATCH 55/79] Update trick conditions in instructions --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index cc27649829..29e7e78135 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -22,7 +22,7 @@ Your program will receive the initial configuration of two players' decks and mu - The moment when the winner of the round collects the cards from the central pile is called a **trick**. - A **trick** can occur in two ways: - When a player finishes paying their penalty. - - When a player runs out of cards, either at the start of their round or while paying a penalty. + - When a player runs out of cards. - The game **ends** when one player can no longer play a card. This can occur at the start of a round or while paying a penalty. - The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! From 96faee989bc0b101930b16ae17d584cdf857c633 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Wed, 3 Sep 2025 23:13:44 +0200 Subject: [PATCH 56/79] improved endgame and tricks --- exercises/camicia/instructions.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 29e7e78135..78f8278152 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -18,13 +18,12 @@ Your program will receive the initial configuration of two players' decks and mu - If the player paying a penalty reveals another payment card, that player stops paying the penalty. The other player must then pay a penalty based on the new payment card. - If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. - That player then starts the next round. + That player then starts the next round _only_ if the opponent still has cards in their deck. - The moment when the winner of the round collects the cards from the central pile is called a **trick**. - A **trick** can occur in two ways: - - When a player finishes paying their penalty. - - When a player runs out of cards. -- The game **ends** when one player can no longer play a card. - This can occur at the start of a round or while paying a penalty. + - When a player finishes paying their penalty, whether or not they run out of cards in the process + - When a player cannot respond to a number card with another number card because their deck has been emptied. +- The game **ends** when one player runs out of cards while paying a penalty in full or in part, or when they cannot respond to a number card due to empty deck. - The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! ## Examples From fb47d80f910e081e3d01507f41635735206115c3 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Thu, 4 Sep 2025 01:30:47 +0200 Subject: [PATCH 57/79] update example 1 Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 78f8278152..def31dc140 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -29,13 +29,24 @@ Your program will receive the initial configuration of two players' decks and mu ## Examples A small example of a match that ends. +| Round | Player A | Player B | Pile | Penalty Due | +| :------ | :----------- | :------------ | :------------------------- | :---------- | +| 1 | 2 A 7 8 Q 10 | 3 4 5 6 K 9 J | | - | +| 1 | A 7 8 Q 10 | 3 4 5 6 K 9 J | 2 | - | +| 1 | A 7 8 Q 10 | 4 5 6 K 9 J | 2 3 | - | +| 1 | 7 8 Q 10 | 4 5 6 K 9 J | 2 3 A | Player B: 4 | +| 1 | 7 8 Q 10 | 5 6 K 9 J | 2 3 A 4 | Player B: 3 | +| 1 | 7 8 Q 10 | 6 K 9 J | 2 3 A 4 5 | Player B: 2 | +| 1 | 7 8 Q 10 | K 9 J | 2 3 A 4 5 6 | Player B: 1 | +| 1 | 7 8 Q 10 | 9 J | 2 3 A 4 5 6 K | Player A: 3 | +| 1 | 8 Q 10 | 9 J | 2 3 A 4 5 6 K 7 | Player A: 2 | +| 1 | Q 10 | 9 J | 2 3 A 4 5 6 K 7 8 | Player A: 1 | +| 1 | 10 | 9 J | 2 3 A 4 5 6 K 7 8 Q | Player B: 2 | +| 1 | 10 | J | 2 3 A 4 5 6 K 7 8 Q 9 | Player B: 1 | +| 1 | 10 | - | 2 3 A 4 5 6 K 7 8 Q 9 J | Player A: 1 | +| 1 | - | - | 2 3 A 4 5 6 K 7 8 Q 9 J 10 | - | -```text -Player A: "2A78Q10" -Player B: "3456K9J" -Pile: 2 → 3 → A → 4 → 5 → 6 → K → 7 → 8 → Q → 9 → J → 10 -(status: "finished", cards: 13, tricks: 1) -``` +status: "finished", cards: 13, tricks: 1 This is a small example of a match that loops. From 2926395a30f7bb429f2d5324551997029386f86b Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Thu, 4 Sep 2025 01:31:40 +0200 Subject: [PATCH 58/79] update example 2 Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 35 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index def31dc140..2e06e200ed 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -50,27 +50,24 @@ status: "finished", cards: 13, tricks: 1 This is a small example of a match that loops. -```text -Player A: "J23" -Player B: "4J5" -Pile: J → 4 -(cards: 2, tricks: 1) +| Round | Player A | Player B | Pile | Penalty Due | +| :---- | :------- | :------- | :---- | :---------- | +| 1 | J 2 3 | 4 J 5 | - | - | +| 1 | 2 3 | 4 J 5 | J | Player B: 1 | +| 1 | 2 3 | J 5 | J 4 | - | +| 2 | 2 3 J 4 | J 5 | - | - | +| 2 | 3 J 4 | J 5 | 2 | - | +| 2 | 3 J 4 | 5 | 2 J | Player A: 1 | +| 2 | J 4 | 5 | 2 J 3 | - | +| 3 | J 4 | 5 2 J 3 | - | - | +| 3 | J 4 | 2 J 3 | 5 | - | +| 3 | 4 | 2 J 3 | 5 J | Player B: 1 | +| 3 | 4 | J 3 | 5 J 2 | - | +| 4 | 4 5 J 2 | J 3 | - | - | -Player A: "23J4" -Player B: "J5" -Pile: 2 → J → 3 -(cards: 5, tricks: 2) +The start of round 4 matches the start of round 2. -Player A: "J4" -Player B: "52J3" -Pile: 5 → J → 2 -(cards: 8, tricks: 3) - -Player A: "45J2" -Player B: "J3" -Payment card configuration already viewed! -(status: "loop", cards: 8, tricks: 3) -``` +status: "loop", cards: 8, tricks: 3 ## Your Task From 2eaa3048fe98b2065900806df56d5dfc7f068bcf Mon Sep 17 00:00:00 2001 From: FraSanga Date: Thu, 4 Sep 2025 01:37:52 +0200 Subject: [PATCH 59/79] fix markdown CI MD058 --- exercises/camicia/instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 2e06e200ed..f56c736f54 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -29,6 +29,7 @@ Your program will receive the initial configuration of two players' decks and mu ## Examples A small example of a match that ends. + | Round | Player A | Player B | Pile | Penalty Due | | :------ | :----------- | :------------ | :------------------------- | :---------- | | 1 | 2 A 7 8 Q 10 | 3 4 5 6 K 9 J | | - | From 953e6c439dd0c4733a6b5493ba69afe28ef74c40 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Thu, 4 Sep 2025 01:43:36 +0200 Subject: [PATCH 60/79] fix table 1 style --- exercises/camicia/instructions.md | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index f56c736f54..50ede4b809 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -30,22 +30,22 @@ Your program will receive the initial configuration of two players' decks and mu A small example of a match that ends. -| Round | Player A | Player B | Pile | Penalty Due | -| :------ | :----------- | :------------ | :------------------------- | :---------- | -| 1 | 2 A 7 8 Q 10 | 3 4 5 6 K 9 J | | - | -| 1 | A 7 8 Q 10 | 3 4 5 6 K 9 J | 2 | - | -| 1 | A 7 8 Q 10 | 4 5 6 K 9 J | 2 3 | - | -| 1 | 7 8 Q 10 | 4 5 6 K 9 J | 2 3 A | Player B: 4 | -| 1 | 7 8 Q 10 | 5 6 K 9 J | 2 3 A 4 | Player B: 3 | -| 1 | 7 8 Q 10 | 6 K 9 J | 2 3 A 4 5 | Player B: 2 | -| 1 | 7 8 Q 10 | K 9 J | 2 3 A 4 5 6 | Player B: 1 | -| 1 | 7 8 Q 10 | 9 J | 2 3 A 4 5 6 K | Player A: 3 | -| 1 | 8 Q 10 | 9 J | 2 3 A 4 5 6 K 7 | Player A: 2 | -| 1 | Q 10 | 9 J | 2 3 A 4 5 6 K 7 8 | Player A: 1 | -| 1 | 10 | 9 J | 2 3 A 4 5 6 K 7 8 Q | Player B: 2 | -| 1 | 10 | J | 2 3 A 4 5 6 K 7 8 Q 9 | Player B: 1 | -| 1 | 10 | - | 2 3 A 4 5 6 K 7 8 Q 9 J | Player A: 1 | -| 1 | - | - | 2 3 A 4 5 6 K 7 8 Q 9 J 10 | - | +| Round | Player A | Player B | Pile | Penalty Due | +| :---- | :----------- | :------------ | :------------------------- | :---------- | +| 1 | 2 A 7 8 Q 10 | 3 4 5 6 K 9 J | | - | +| 1 | A 7 8 Q 10 | 3 4 5 6 K 9 J | 2 | - | +| 1 | A 7 8 Q 10 | 4 5 6 K 9 J | 2 3 | - | +| 1 | 7 8 Q 10 | 4 5 6 K 9 J | 2 3 A | Player B: 4 | +| 1 | 7 8 Q 10 | 5 6 K 9 J | 2 3 A 4 | Player B: 3 | +| 1 | 7 8 Q 10 | 6 K 9 J | 2 3 A 4 5 | Player B: 2 | +| 1 | 7 8 Q 10 | K 9 J | 2 3 A 4 5 6 | Player B: 1 | +| 1 | 7 8 Q 10 | 9 J | 2 3 A 4 5 6 K | Player A: 3 | +| 1 | 8 Q 10 | 9 J | 2 3 A 4 5 6 K 7 | Player A: 2 | +| 1 | Q 10 | 9 J | 2 3 A 4 5 6 K 7 8 | Player A: 1 | +| 1 | 10 | 9 J | 2 3 A 4 5 6 K 7 8 Q | Player B: 2 | +| 1 | 10 | J | 2 3 A 4 5 6 K 7 8 Q 9 | Player B: 1 | +| 1 | 10 | - | 2 3 A 4 5 6 K 7 8 Q 9 J | Player A: 1 | +| 1 | - | - | 2 3 A 4 5 6 K 7 8 Q 9 J 10 | - | status: "finished", cards: 13, tricks: 1 From 49f64411e53a7c4221d9acb0df288e0591b59f09 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Fri, 5 Sep 2025 23:19:09 +0200 Subject: [PATCH 61/79] changed test cases with arrays --- exercises/camicia/canonical-data.json | 1391 ++++++++++++++++++++++++- 1 file changed, 1335 insertions(+), 56 deletions(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index 81947be599..a6551191dd 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -6,8 +6,12 @@ "description": "two cards, one trick", "property": "simulateGame", "input": { - "playerA": "2", - "playerB": "3" + "playerA": [ + "2" + ], + "playerB": [ + "3" + ] }, "expected": { "status": "finished", @@ -20,8 +24,13 @@ "description": "three cards, one trick", "property": "simulateGame", "input": { - "playerA": "24", - "playerB": "3" + "playerA": [ + "2", + "4" + ], + "playerB": [ + "3" + ] }, "expected": { "status": "finished", @@ -34,8 +43,15 @@ "description": "four cards, one trick", "property": "simulateGame", "input": { - "playerA": "24", - "playerB": "356" + "playerA": [ + "2", + "4" + ], + "playerB": [ + "3", + "5", + "6" + ] }, "expected": { "status": "finished", @@ -48,8 +64,17 @@ "description": "the ace reigns supreme", "property": "simulateGame", "input": { - "playerA": "2A", - "playerB": "34567" + "playerA": [ + "2", + "A" + ], + "playerB": [ + "3", + "4", + "5", + "6", + "7" + ] }, "expected": { "status": "finished", @@ -62,8 +87,17 @@ "description": "the king beats ace", "property": "simulateGame", "input": { - "playerA": "2A", - "playerB": "3456K" + "playerA": [ + "2", + "A" + ], + "playerB": [ + "3", + "4", + "5", + "6", + "K" + ] }, "expected": { "status": "finished", @@ -76,8 +110,20 @@ "description": "the queen seduces the king", "property": "simulateGame", "input": { - "playerA": "2A78Q", - "playerB": "3456K" + "playerA": [ + "2", + "A", + "7", + "8", + "Q" + ], + "playerB": [ + "3", + "4", + "5", + "6", + "K" + ] }, "expected": { "status": "finished", @@ -90,8 +136,22 @@ "description": "the jack betrays the queen", "property": "simulateGame", "input": { - "playerA": "2A78Q", - "playerB": "3456K9J" + "playerA": [ + "2", + "A", + "7", + "8", + "Q" + ], + "playerB": [ + "3", + "4", + "5", + "6", + "K", + "9", + "J" + ] }, "expected": { "status": "finished", @@ -104,8 +164,23 @@ "description": "the 10 just wants to put on a show", "property": "simulateGame", "input": { - "playerA": "2A78Q10", - "playerB": "3456K9J" + "playerA": [ + "2", + "A", + "7", + "8", + "Q", + "10" + ], + "playerB": [ + "3", + "4", + "5", + "6", + "K", + "9", + "J" + ] }, "expected": { "status": "finished", @@ -118,8 +193,371 @@ "description": "the story is starting to get a bit complicated", "property": "simulateGame", "input": { - "playerA": "266J4KQ10KJQ23K56QQAA69KA8K2A9AQ4KKK35K8Q3Q7JKJ9J33KKQAK710AQ710J45J910QJJK610J6QJ5JQQ838A269K7JKK8KQ610J10JQJ1038KA69K2AA10J6A4JAJJ62J3K259J96KA5QJ2QKA3KJK256QJQQJ2J9Q77AQ7QJKJA778Q10J10JJ92A2", - "playerB": "7210K82J9A56JQ6K65A4Q7J7102Q822KJA55A4Q6QK108Q210JAQ8QQJJAA910JK4Q1010JK102J7AKKJAJ108KA7QQJ3Q4A3AQQQ54KJ10AQJ6JA10A583K59Q877J7QQQA789AQAK8AAJ848KJA10Q8J8610QJJAAJ5Q6JKQ8K4QQ6JK47JJ99AQQKA65K" + "playerA": [ + "2", + "6", + "6", + "J", + "4", + "K", + "Q", + "10", + "K", + "J", + "Q", + "2", + "3", + "K", + "5", + "6", + "Q", + "Q", + "A", + "A", + "6", + "9", + "K", + "A", + "8", + "K", + "2", + "A", + "9", + "A", + "Q", + "4", + "K", + "K", + "K", + "3", + "5", + "K", + "8", + "Q", + "3", + "Q", + "7", + "J", + "K", + "J", + "9", + "J", + "3", + "3", + "K", + "K", + "Q", + "A", + "K", + "7", + "10", + "A", + "Q", + "7", + "10", + "J", + "4", + "5", + "J", + "9", + "10", + "Q", + "J", + "J", + "K", + "6", + "10", + "J", + "6", + "Q", + "J", + "5", + "J", + "Q", + "Q", + "8", + "3", + "8", + "A", + "2", + "6", + "9", + "K", + "7", + "J", + "K", + "K", + "8", + "K", + "Q", + "6", + "10", + "J", + "10", + "J", + "Q", + "J", + "10", + "3", + "8", + "K", + "A", + "6", + "9", + "K", + "2", + "A", + "A", + "10", + "J", + "6", + "A", + "4", + "J", + "A", + "J", + "J", + "6", + "2", + "J", + "3", + "K", + "2", + "5", + "9", + "J", + "9", + "6", + "K", + "A", + "5", + "Q", + "J", + "2", + "Q", + "K", + "A", + "3", + "K", + "J", + "K", + "2", + "5", + "6", + "Q", + "J", + "Q", + "Q", + "J", + "2", + "J", + "9", + "Q", + "7", + "7", + "A", + "Q", + "7", + "Q", + "J", + "K", + "J", + "A", + "7", + "7", + "8", + "Q", + "10", + "J", + "10", + "J", + "J", + "9", + "2", + "A", + "2" + ], + "playerB": [ + "7", + "2", + "10", + "K", + "8", + "2", + "J", + "9", + "A", + "5", + "6", + "J", + "Q", + "6", + "K", + "6", + "5", + "A", + "4", + "Q", + "7", + "J", + "7", + "10", + "2", + "Q", + "8", + "2", + "2", + "K", + "J", + "A", + "5", + "5", + "A", + "4", + "Q", + "6", + "Q", + "K", + "10", + "8", + "Q", + "2", + "10", + "J", + "A", + "Q", + "8", + "Q", + "Q", + "J", + "J", + "A", + "A", + "9", + "10", + "J", + "K", + "4", + "Q", + "10", + "10", + "J", + "K", + "10", + "2", + "J", + "7", + "A", + "K", + "K", + "J", + "A", + "J", + "10", + "8", + "K", + "A", + "7", + "Q", + "Q", + "J", + "3", + "Q", + "4", + "A", + "3", + "A", + "Q", + "Q", + "Q", + "5", + "4", + "K", + "J", + "10", + "A", + "Q", + "J", + "6", + "J", + "A", + "10", + "A", + "5", + "8", + "3", + "K", + "5", + "9", + "Q", + "8", + "7", + "7", + "J", + "7", + "Q", + "Q", + "Q", + "A", + "7", + "8", + "9", + "A", + "Q", + "A", + "K", + "8", + "A", + "A", + "J", + "8", + "4", + "8", + "K", + "J", + "A", + "10", + "Q", + "8", + "J", + "8", + "6", + "10", + "Q", + "J", + "J", + "A", + "A", + "J", + "5", + "Q", + "6", + "J", + "K", + "Q", + "8", + "K", + "4", + "Q", + "Q", + "6", + "J", + "K", + "4", + "7", + "J", + "J", + "9", + "9", + "A", + "Q", + "Q", + "K", + "A", + "6", + "5", + "K" + ] }, "expected": { "status": "finished", @@ -132,8 +570,13 @@ "description": "two tricks", "property": "simulateGame", "input": { - "playerA": "J", - "playerB": "3J" + "playerA": [ + "J" + ], + "playerB": [ + "3", + "J" + ] }, "expected": { "status": "finished", @@ -146,8 +589,16 @@ "description": "more tricks", "property": "simulateGame", "input": { - "playerA": "J24", - "playerB": "3JA" + "playerA": [ + "J", + "2", + "4" + ], + "playerB": [ + "3", + "J", + "A" + ] }, "expected": { "status": "finished", @@ -160,8 +611,16 @@ "description": "simple loop with decks of 3 cards", "property": "simulateGame", "input": { - "playerA": "J23", - "playerB": "4J5" + "playerA": [ + "J", + "2", + "3" + ], + "playerB": [ + "4", + "J", + "5" + ] }, "expected": { "status": "loop", @@ -174,8 +633,18 @@ "description": "simple loop with decks of 4 cards", "property": "simulateGame", "input": { - "playerA": "23J6", - "playerB": "K5J7" + "playerA": [ + "2", + "3", + "J", + "6" + ], + "playerB": [ + "K", + "5", + "J", + "7" + ] }, "expected": { "status": "loop", @@ -188,8 +657,62 @@ "description": "easy card combination", "property": "simulateGame", "input": { - "playerA": "487541039731010682854596528109", - "playerB": "6947223673AAAAKKKKQQQQJJJJ" + "playerA": [ + "4", + "8", + "7", + "5", + "4", + "10", + "3", + "9", + "7", + "3", + "10", + "10", + "6", + "8", + "2", + "8", + "5", + "4", + "5", + "9", + "6", + "5", + "2", + "8", + "10", + "9" + ], + "playerB": [ + "6", + "9", + "4", + "7", + "2", + "2", + "3", + "6", + "7", + "3", + "A", + "A", + "A", + "A", + "K", + "K", + "K", + "K", + "Q", + "Q", + "Q", + "Q", + "J", + "J", + "J", + "J" + ] }, "expected": { "status": "finished", @@ -202,8 +725,62 @@ "description": "easy card combination, inverted decks", "property": "simulateGame", "input": { - "playerA": "33573210767AAAAKKKKQQQQJJJJ", - "playerB": "51082672492610105484869859349" + "playerA": [ + "3", + "3", + "5", + "7", + "3", + "2", + "10", + "7", + "6", + "7", + "A", + "A", + "A", + "A", + "K", + "K", + "K", + "K", + "Q", + "Q", + "Q", + "Q", + "J", + "J", + "J", + "J" + ], + "playerB": [ + "5", + "10", + "8", + "2", + "6", + "7", + "2", + "4", + "9", + "2", + "6", + "10", + "10", + "5", + "4", + "8", + "4", + "8", + "6", + "9", + "8", + "5", + "9", + "3", + "4", + "9" + ] }, "expected": { "status": "finished", @@ -216,8 +793,62 @@ "description": "mirrored decks", "property": "simulateGame", "input": { - "playerA": "2A3A3K4K2Q2Q10J5J610291073969", - "playerB": "6A4A7K4K7Q7Q5J8J45891068385" + "playerA": [ + "2", + "A", + "3", + "A", + "3", + "K", + "4", + "K", + "2", + "Q", + "2", + "Q", + "10", + "J", + "5", + "J", + "6", + "10", + "2", + "9", + "10", + "7", + "3", + "9", + "6", + "9" + ], + "playerB": [ + "6", + "A", + "4", + "A", + "7", + "K", + "4", + "K", + "7", + "Q", + "7", + "Q", + "5", + "J", + "8", + "J", + "4", + "5", + "8", + "9", + "10", + "6", + "8", + "3", + "8", + "5" + ] }, "expected": { "status": "finished", @@ -230,8 +861,62 @@ "description": "opposite decks", "property": "simulateGame", "input": { - "playerA": "4A9A4K9K6Q8Q8J10J9846365243", - "playerB": "10732927875J7J10Q10Q3K5K6A2A5" + "playerA": [ + "4", + "A", + "9", + "A", + "4", + "K", + "9", + "K", + "6", + "Q", + "8", + "Q", + "8", + "J", + "10", + "J", + "9", + "8", + "4", + "6", + "3", + "6", + "5", + "2", + "4", + "3" + ], + "playerB": [ + "10", + "7", + "3", + "2", + "9", + "2", + "7", + "8", + "7", + "5", + "J", + "7", + "J", + "10", + "Q", + "10", + "Q", + "3", + "K", + "5", + "K", + "6", + "A", + "2", + "A", + "5" + ] }, "expected": { "status": "finished", @@ -244,8 +929,62 @@ "description": "random decks #1", "property": "simulateGame", "input": { - "playerA": "K1098J8697AK544J5J435867749", - "playerB": "63KAQ10A2Q8210102Q3K97A3Q5J26" + "playerA": [ + "K", + "10", + "9", + "8", + "J", + "8", + "6", + "9", + "7", + "A", + "K", + "5", + "4", + "4", + "J", + "5", + "J", + "4", + "3", + "5", + "8", + "6", + "7", + "7", + "4", + "9" + ], + "playerB": [ + "6", + "3", + "K", + "A", + "Q", + "10", + "A", + "2", + "Q", + "8", + "2", + "10", + "10", + "2", + "Q", + "3", + "K", + "9", + "7", + "A", + "3", + "Q", + "5", + "J", + "2", + "6" + ] }, "expected": { "status": "finished", @@ -258,8 +997,62 @@ "description": "random decks #2", "property": "simulateGame", "input": { - "playerA": "8A485QJ26297KA810K8109K673K9", - "playerB": "10526QJA955373JA2Q3JQ4104746" + "playerA": [ + "8", + "A", + "4", + "8", + "5", + "Q", + "J", + "2", + "6", + "2", + "9", + "7", + "K", + "A", + "8", + "10", + "K", + "8", + "10", + "9", + "K", + "6", + "7", + "3", + "K", + "9" + ], + "playerB": [ + "10", + "5", + "2", + "6", + "Q", + "J", + "A", + "9", + "5", + "5", + "3", + "7", + "3", + "J", + "A", + "2", + "Q", + "3", + "J", + "Q", + "4", + "10", + "4", + "7", + "4", + "6" + ] }, "expected": { "status": "finished", @@ -272,8 +1065,62 @@ "description": "Kleber 1999", "property": "simulateGame", "input": { - "playerA": "489JQ855K2A98510A4J3K692QK7", - "playerB": "10J324104753667AJQA72103K968Q" + "playerA": [ + "4", + "8", + "9", + "J", + "Q", + "8", + "5", + "5", + "K", + "2", + "A", + "9", + "8", + "5", + "10", + "A", + "4", + "J", + "3", + "K", + "6", + "9", + "2", + "Q", + "K", + "7" + ], + "playerB": [ + "10", + "J", + "3", + "2", + "4", + "10", + "4", + "7", + "5", + "3", + "6", + "6", + "7", + "A", + "J", + "Q", + "A", + "7", + "2", + "10", + "3", + "K", + "9", + "6", + "8", + "Q" + ] }, "expected": { "status": "finished", @@ -286,8 +1133,62 @@ "description": "Collins 2006", "property": "simulateGame", "input": { - "playerA": "A8QK9103742Q32109KA87745J9210", - "playerB": "4JAK8566A65Q46108J257QJ33K9" + "playerA": [ + "A", + "8", + "Q", + "K", + "9", + "10", + "3", + "7", + "4", + "2", + "Q", + "3", + "2", + "10", + "9", + "K", + "A", + "8", + "7", + "7", + "4", + "5", + "J", + "9", + "2", + "10" + ], + "playerB": [ + "4", + "J", + "A", + "K", + "8", + "5", + "6", + "6", + "A", + "6", + "5", + "Q", + "4", + "6", + "10", + "8", + "J", + "2", + "5", + "7", + "Q", + "J", + "3", + "3", + "K", + "9" + ] }, "expected": { "status": "finished", @@ -300,8 +1201,62 @@ "description": "Mann and Wu 2007", "property": "simulateGame", "input": { - "playerA": "K2KK33610K6A25579JAA34Q48J6", - "playerB": "452Q799Q7J9810310J4108687AQ52" + "playerA": [ + "K", + "2", + "K", + "K", + "3", + "3", + "6", + "10", + "K", + "6", + "A", + "2", + "5", + "5", + "7", + "9", + "J", + "A", + "A", + "3", + "4", + "Q", + "4", + "8", + "J", + "6" + ], + "playerB": [ + "4", + "5", + "2", + "Q", + "7", + "9", + "9", + "Q", + "7", + "J", + "9", + "8", + "10", + "3", + "10", + "J", + "4", + "10", + "8", + "6", + "8", + "7", + "A", + "Q", + "5", + "2" + ] }, "expected": { "status": "finished", @@ -314,8 +1269,62 @@ "description": "Nessler 2012", "property": "simulateGame", "input": { - "playerA": "10367Q298284A106K210A5A24QJK4", - "playerB": "10Q46J93J933QK595K6578JA787" + "playerA": [ + "10", + "3", + "6", + "7", + "Q", + "2", + "9", + "8", + "2", + "8", + "4", + "A", + "10", + "6", + "K", + "2", + "10", + "A", + "5", + "A", + "2", + "4", + "Q", + "J", + "K", + "4" + ], + "playerB": [ + "10", + "Q", + "4", + "6", + "J", + "9", + "3", + "J", + "9", + "3", + "3", + "Q", + "K", + "5", + "9", + "5", + "K", + "6", + "5", + "7", + "8", + "J", + "A", + "7", + "8", + "7" + ] }, "expected": { "status": "finished", @@ -328,8 +1337,62 @@ "description": "Anderson 2013", "property": "simulateGame", "input": { - "playerA": "67A3Q35J32J745Q105AJ2K899K3", - "playerB": "4J69851079Q27108410A64A68QKK2" + "playerA": [ + "6", + "7", + "A", + "3", + "Q", + "3", + "5", + "J", + "3", + "2", + "J", + "7", + "4", + "5", + "Q", + "10", + "5", + "A", + "J", + "2", + "K", + "8", + "9", + "9", + "K", + "3" + ], + "playerB": [ + "4", + "J", + "6", + "9", + "8", + "5", + "10", + "7", + "9", + "Q", + "2", + "7", + "10", + "8", + "4", + "10", + "A", + "6", + "4", + "A", + "6", + "8", + "Q", + "K", + "K", + "2" + ] }, "expected": { "status": "finished", @@ -342,8 +1405,62 @@ "description": "Rucklidge 2014", "property": "simulateGame", "input": { - "playerA": "8J294458Q393628AAA94725QQ3", - "playerB": "K71063JA7655810910427KQ10K6JJK" + "playerA": [ + "8", + "J", + "2", + "9", + "4", + "4", + "5", + "8", + "Q", + "3", + "9", + "3", + "6", + "2", + "8", + "A", + "A", + "A", + "9", + "4", + "7", + "2", + "5", + "Q", + "Q", + "3" + ], + "playerB": [ + "K", + "7", + "10", + "6", + "3", + "J", + "A", + "7", + "6", + "5", + "5", + "8", + "10", + "9", + "10", + "4", + "2", + "7", + "K", + "Q", + "10", + "K", + "6", + "J", + "J", + "K" + ] }, "expected": { "status": "finished", @@ -356,8 +1473,62 @@ "description": "Nessler 2021", "property": "simulateGame", "input": { - "playerA": "7234K9610A89Q7A48JJA432566J", - "playerB": "310898KK255764357A9JK2Q10Q10Q" + "playerA": [ + "7", + "2", + "3", + "4", + "K", + "9", + "6", + "10", + "A", + "8", + "9", + "Q", + "7", + "A", + "4", + "8", + "J", + "J", + "A", + "4", + "3", + "2", + "5", + "6", + "6", + "J" + ], + "playerB": [ + "3", + "10", + "8", + "9", + "8", + "K", + "K", + "2", + "5", + "5", + "7", + "6", + "4", + "3", + "5", + "7", + "A", + "9", + "J", + "K", + "2", + "Q", + "10", + "Q", + "10", + "Q" + ] }, "expected": { "status": "finished", @@ -370,8 +1541,62 @@ "description": "Nessler 2022", "property": "simulateGame", "input": { - "playerA": "21010AJ38Q2555924310QAKQJJ9QK", - "playerB": "107636A8943KJ6K49785782A746" + "playerA": [ + "2", + "10", + "10", + "A", + "J", + "3", + "8", + "Q", + "2", + "5", + "5", + "5", + "9", + "2", + "4", + "3", + "10", + "Q", + "A", + "K", + "Q", + "J", + "J", + "9", + "Q", + "K" + ], + "playerB": [ + "10", + "7", + "6", + "3", + "6", + "A", + "8", + "9", + "4", + "3", + "K", + "J", + "6", + "K", + "4", + "9", + "7", + "8", + "5", + "7", + "8", + "2", + "A", + "7", + "4", + "6" + ] }, "expected": { "status": "finished", @@ -384,8 +1609,62 @@ "description": "Casella 2024, first infinite game found", "property": "simulateGame", "input": { - "playerA": "284K523Q6KQAJ35983AAJ44J75", - "playerB": "7786101061072Q6324KQ10J59899KA" + "playerA": [ + "2", + "8", + "4", + "K", + "5", + "2", + "3", + "Q", + "6", + "K", + "Q", + "A", + "J", + "3", + "5", + "9", + "8", + "3", + "A", + "A", + "J", + "4", + "4", + "J", + "7", + "5" + ], + "playerB": [ + "7", + "7", + "8", + "6", + "10", + "10", + "6", + "10", + "7", + "2", + "Q", + "6", + "3", + "2", + "4", + "K", + "Q", + "10", + "J", + "5", + "9", + "8", + "9", + "9", + "K", + "A" + ] }, "expected": { "status": "loop", From b65f34ea2fafc6cb620dd95baa7d0dbefc96569c Mon Sep 17 00:00:00 2001 From: FraSanga Date: Fri, 5 Sep 2025 23:46:21 +0200 Subject: [PATCH 62/79] simplified rules --- exercises/camicia/instructions.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 50ede4b809..c407a2107c 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -6,7 +6,7 @@ Your program will receive the initial configuration of two players' decks and mu ## Rules - The deck is split between **two players**. - Each player's cards are represented as a string where the leftmost character is the top of the deck. + The player's cards are read from left to right, where the leftmost card is the top of the deck. - A round consists of both players playing at least one card/turn. - Players take a turn by placing the **top card** of their deck onto a central pile. - If the card is a **number card** (2-10), play simply passes to the other player. @@ -18,12 +18,10 @@ Your program will receive the initial configuration of two players' decks and mu - If the player paying a penalty reveals another payment card, that player stops paying the penalty. The other player must then pay a penalty based on the new payment card. - If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. - That player then starts the next round _only_ if the opponent still has cards in their deck. -- The moment when the winner of the round collects the cards from the central pile is called a **trick**. -- A **trick** can occur in two ways: - - When a player finishes paying their penalty, whether or not they run out of cards in the process - - When a player cannot respond to a number card with another number card because their deck has been emptied. -- The game **ends** when one player runs out of cards while paying a penalty in full or in part, or when they cannot respond to a number card due to empty deck. + That player then starts the next round. +- The moment when a player collects cards from the central pile is called a **trick**. +- If a player has all the cards in their possession after a trick, the game **ends**. +- The game **ends** when one player has all the cards in their deck. - The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! ## Examples From 8b05dee0537d90b769d38097ad581657225560ee Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sat, 6 Sep 2025 00:28:04 +0200 Subject: [PATCH 63/79] fix array json CI --- exercises/camicia/canonical-data.json | 1391 +------------------------ 1 file changed, 56 insertions(+), 1335 deletions(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index a6551191dd..96aacef0f2 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -6,12 +6,8 @@ "description": "two cards, one trick", "property": "simulateGame", "input": { - "playerA": [ - "2" - ], - "playerB": [ - "3" - ] + "playerA": ["2"], + "playerB": ["3"] }, "expected": { "status": "finished", @@ -24,13 +20,8 @@ "description": "three cards, one trick", "property": "simulateGame", "input": { - "playerA": [ - "2", - "4" - ], - "playerB": [ - "3" - ] + "playerA": ["2", "4"], + "playerB": ["3"] }, "expected": { "status": "finished", @@ -43,15 +34,8 @@ "description": "four cards, one trick", "property": "simulateGame", "input": { - "playerA": [ - "2", - "4" - ], - "playerB": [ - "3", - "5", - "6" - ] + "playerA": ["2", "4"], + "playerB": ["3", "5", "6"] }, "expected": { "status": "finished", @@ -64,17 +48,8 @@ "description": "the ace reigns supreme", "property": "simulateGame", "input": { - "playerA": [ - "2", - "A" - ], - "playerB": [ - "3", - "4", - "5", - "6", - "7" - ] + "playerA": ["2", "A"], + "playerB": ["3", "4", "5", "6", "7"] }, "expected": { "status": "finished", @@ -87,17 +62,8 @@ "description": "the king beats ace", "property": "simulateGame", "input": { - "playerA": [ - "2", - "A" - ], - "playerB": [ - "3", - "4", - "5", - "6", - "K" - ] + "playerA": ["2", "A"], + "playerB": ["3", "4", "5", "6", "K"] }, "expected": { "status": "finished", @@ -110,20 +76,8 @@ "description": "the queen seduces the king", "property": "simulateGame", "input": { - "playerA": [ - "2", - "A", - "7", - "8", - "Q" - ], - "playerB": [ - "3", - "4", - "5", - "6", - "K" - ] + "playerA": ["2", "A", "7", "8", "Q"], + "playerB": ["3", "4", "5", "6", "K"] }, "expected": { "status": "finished", @@ -136,22 +90,8 @@ "description": "the jack betrays the queen", "property": "simulateGame", "input": { - "playerA": [ - "2", - "A", - "7", - "8", - "Q" - ], - "playerB": [ - "3", - "4", - "5", - "6", - "K", - "9", - "J" - ] + "playerA": ["2", "A", "7", "8", "Q"], + "playerB": ["3", "4", "5", "6", "K", "9", "J"] }, "expected": { "status": "finished", @@ -164,23 +104,8 @@ "description": "the 10 just wants to put on a show", "property": "simulateGame", "input": { - "playerA": [ - "2", - "A", - "7", - "8", - "Q", - "10" - ], - "playerB": [ - "3", - "4", - "5", - "6", - "K", - "9", - "J" - ] + "playerA": ["2", "A", "7", "8", "Q", "10"], + "playerB": ["3", "4", "5", "6", "K", "9", "J"] }, "expected": { "status": "finished", @@ -193,371 +118,8 @@ "description": "the story is starting to get a bit complicated", "property": "simulateGame", "input": { - "playerA": [ - "2", - "6", - "6", - "J", - "4", - "K", - "Q", - "10", - "K", - "J", - "Q", - "2", - "3", - "K", - "5", - "6", - "Q", - "Q", - "A", - "A", - "6", - "9", - "K", - "A", - "8", - "K", - "2", - "A", - "9", - "A", - "Q", - "4", - "K", - "K", - "K", - "3", - "5", - "K", - "8", - "Q", - "3", - "Q", - "7", - "J", - "K", - "J", - "9", - "J", - "3", - "3", - "K", - "K", - "Q", - "A", - "K", - "7", - "10", - "A", - "Q", - "7", - "10", - "J", - "4", - "5", - "J", - "9", - "10", - "Q", - "J", - "J", - "K", - "6", - "10", - "J", - "6", - "Q", - "J", - "5", - "J", - "Q", - "Q", - "8", - "3", - "8", - "A", - "2", - "6", - "9", - "K", - "7", - "J", - "K", - "K", - "8", - "K", - "Q", - "6", - "10", - "J", - "10", - "J", - "Q", - "J", - "10", - "3", - "8", - "K", - "A", - "6", - "9", - "K", - "2", - "A", - "A", - "10", - "J", - "6", - "A", - "4", - "J", - "A", - "J", - "J", - "6", - "2", - "J", - "3", - "K", - "2", - "5", - "9", - "J", - "9", - "6", - "K", - "A", - "5", - "Q", - "J", - "2", - "Q", - "K", - "A", - "3", - "K", - "J", - "K", - "2", - "5", - "6", - "Q", - "J", - "Q", - "Q", - "J", - "2", - "J", - "9", - "Q", - "7", - "7", - "A", - "Q", - "7", - "Q", - "J", - "K", - "J", - "A", - "7", - "7", - "8", - "Q", - "10", - "J", - "10", - "J", - "J", - "9", - "2", - "A", - "2" - ], - "playerB": [ - "7", - "2", - "10", - "K", - "8", - "2", - "J", - "9", - "A", - "5", - "6", - "J", - "Q", - "6", - "K", - "6", - "5", - "A", - "4", - "Q", - "7", - "J", - "7", - "10", - "2", - "Q", - "8", - "2", - "2", - "K", - "J", - "A", - "5", - "5", - "A", - "4", - "Q", - "6", - "Q", - "K", - "10", - "8", - "Q", - "2", - "10", - "J", - "A", - "Q", - "8", - "Q", - "Q", - "J", - "J", - "A", - "A", - "9", - "10", - "J", - "K", - "4", - "Q", - "10", - "10", - "J", - "K", - "10", - "2", - "J", - "7", - "A", - "K", - "K", - "J", - "A", - "J", - "10", - "8", - "K", - "A", - "7", - "Q", - "Q", - "J", - "3", - "Q", - "4", - "A", - "3", - "A", - "Q", - "Q", - "Q", - "5", - "4", - "K", - "J", - "10", - "A", - "Q", - "J", - "6", - "J", - "A", - "10", - "A", - "5", - "8", - "3", - "K", - "5", - "9", - "Q", - "8", - "7", - "7", - "J", - "7", - "Q", - "Q", - "Q", - "A", - "7", - "8", - "9", - "A", - "Q", - "A", - "K", - "8", - "A", - "A", - "J", - "8", - "4", - "8", - "K", - "J", - "A", - "10", - "Q", - "8", - "J", - "8", - "6", - "10", - "Q", - "J", - "J", - "A", - "A", - "J", - "5", - "Q", - "6", - "J", - "K", - "Q", - "8", - "K", - "4", - "Q", - "Q", - "6", - "J", - "K", - "4", - "7", - "J", - "J", - "9", - "9", - "A", - "Q", - "Q", - "K", - "A", - "6", - "5", - "K" - ] + "playerA": ["2", "6", "6", "J", "4", "K", "Q", "10", "K", "J", "Q", "2", "3", "K", "5", "6", "Q", "Q", "A", "A", "6", "9", "K", "A", "8", "K", "2", "A", "9", "A", "Q", "4", "K", "K", "K", "3", "5", "K", "8", "Q", "3", "Q", "7", "J", "K", "J", "9", "J", "3", "3", "K", "K", "Q", "A", "K", "7", "10", "A", "Q", "7", "10", "J", "4", "5", "J", "9", "10", "Q", "J", "J", "K", "6", "10", "J", "6", "Q", "J", "5", "J", "Q", "Q", "8", "3", "8", "A", "2", "6", "9", "K", "7", "J", "K", "K", "8", "K", "Q", "6", "10", "J", "10", "J", "Q", "J", "10", "3", "8", "K", "A", "6", "9", "K", "2", "A", "A", "10", "J", "6", "A", "4", "J", "A", "J", "J", "6", "2", "J", "3", "K", "2", "5", "9", "J", "9", "6", "K", "A", "5", "Q", "J", "2", "Q", "K", "A", "3", "K", "J", "K", "2", "5", "6", "Q", "J", "Q", "Q", "J", "2", "J", "9", "Q", "7", "7", "A", "Q", "7", "Q", "J", "K", "J", "A", "7", "7", "8", "Q", "10", "J", "10", "J", "J", "9", "2", "A", "2"], + "playerB": ["7", "2", "10", "K", "8", "2", "J", "9", "A", "5", "6", "J", "Q", "6", "K", "6", "5", "A", "4", "Q", "7", "J", "7", "10", "2", "Q", "8", "2", "2", "K", "J", "A", "5", "5", "A", "4", "Q", "6", "Q", "K", "10", "8", "Q", "2", "10", "J", "A", "Q", "8", "Q", "Q", "J", "J", "A", "A", "9", "10", "J", "K", "4", "Q", "10", "10", "J", "K", "10", "2", "J", "7", "A", "K", "K", "J", "A", "J", "10", "8", "K", "A", "7", "Q", "Q", "J", "3", "Q", "4", "A", "3", "A", "Q", "Q", "Q", "5", "4", "K", "J", "10", "A", "Q", "J", "6", "J", "A", "10", "A", "5", "8", "3", "K", "5", "9", "Q", "8", "7", "7", "J", "7", "Q", "Q", "Q", "A", "7", "8", "9", "A", "Q", "A", "K", "8", "A", "A", "J", "8", "4", "8", "K", "J", "A", "10", "Q", "8", "J", "8", "6", "10", "Q", "J", "J", "A", "A", "J", "5", "Q", "6", "J", "K", "Q", "8", "K", "4", "Q", "Q", "6", "J", "K", "4", "7", "J", "J", "9", "9", "A", "Q", "Q", "K", "A", "6", "5", "K"] }, "expected": { "status": "finished", @@ -570,13 +132,8 @@ "description": "two tricks", "property": "simulateGame", "input": { - "playerA": [ - "J" - ], - "playerB": [ - "3", - "J" - ] + "playerA": ["J"], + "playerB": ["3", "J"] }, "expected": { "status": "finished", @@ -589,16 +146,8 @@ "description": "more tricks", "property": "simulateGame", "input": { - "playerA": [ - "J", - "2", - "4" - ], - "playerB": [ - "3", - "J", - "A" - ] + "playerA": ["J", "2", "4"], + "playerB": ["3", "J", "A"] }, "expected": { "status": "finished", @@ -611,16 +160,8 @@ "description": "simple loop with decks of 3 cards", "property": "simulateGame", "input": { - "playerA": [ - "J", - "2", - "3" - ], - "playerB": [ - "4", - "J", - "5" - ] + "playerA": ["J", "2", "3"], + "playerB": ["4", "J", "5"] }, "expected": { "status": "loop", @@ -633,18 +174,8 @@ "description": "simple loop with decks of 4 cards", "property": "simulateGame", "input": { - "playerA": [ - "2", - "3", - "J", - "6" - ], - "playerB": [ - "K", - "5", - "J", - "7" - ] + "playerA": ["2", "3", "J", "6"], + "playerB": ["K", "5", "J", "7"] }, "expected": { "status": "loop", @@ -657,62 +188,8 @@ "description": "easy card combination", "property": "simulateGame", "input": { - "playerA": [ - "4", - "8", - "7", - "5", - "4", - "10", - "3", - "9", - "7", - "3", - "10", - "10", - "6", - "8", - "2", - "8", - "5", - "4", - "5", - "9", - "6", - "5", - "2", - "8", - "10", - "9" - ], - "playerB": [ - "6", - "9", - "4", - "7", - "2", - "2", - "3", - "6", - "7", - "3", - "A", - "A", - "A", - "A", - "K", - "K", - "K", - "K", - "Q", - "Q", - "Q", - "Q", - "J", - "J", - "J", - "J" - ] + "playerA": ["4", "8", "7", "5", "4", "10", "3", "9", "7", "3", "10", "10", "6", "8", "2", "8", "5", "4", "5", "9", "6", "5", "2", "8", "10", "9"], + "playerB": ["6", "9", "4", "7", "2", "2", "3", "6", "7", "3", "A", "A", "A", "A", "K", "K", "K", "K", "Q", "Q", "Q", "Q", "J", "J", "J", "J"] }, "expected": { "status": "finished", @@ -725,62 +202,8 @@ "description": "easy card combination, inverted decks", "property": "simulateGame", "input": { - "playerA": [ - "3", - "3", - "5", - "7", - "3", - "2", - "10", - "7", - "6", - "7", - "A", - "A", - "A", - "A", - "K", - "K", - "K", - "K", - "Q", - "Q", - "Q", - "Q", - "J", - "J", - "J", - "J" - ], - "playerB": [ - "5", - "10", - "8", - "2", - "6", - "7", - "2", - "4", - "9", - "2", - "6", - "10", - "10", - "5", - "4", - "8", - "4", - "8", - "6", - "9", - "8", - "5", - "9", - "3", - "4", - "9" - ] + "playerA": ["3", "3", "5", "7", "3", "2", "10", "7", "6", "7", "A", "A", "A", "A", "K", "K", "K", "K", "Q", "Q", "Q", "Q", "J", "J", "J", "J"], + "playerB": ["5", "10", "8", "2", "6", "7", "2", "4", "9", "2", "6", "10", "10", "5", "4", "8", "4", "8", "6", "9", "8", "5", "9", "3", "4", "9"] }, "expected": { "status": "finished", @@ -793,62 +216,8 @@ "description": "mirrored decks", "property": "simulateGame", "input": { - "playerA": [ - "2", - "A", - "3", - "A", - "3", - "K", - "4", - "K", - "2", - "Q", - "2", - "Q", - "10", - "J", - "5", - "J", - "6", - "10", - "2", - "9", - "10", - "7", - "3", - "9", - "6", - "9" - ], - "playerB": [ - "6", - "A", - "4", - "A", - "7", - "K", - "4", - "K", - "7", - "Q", - "7", - "Q", - "5", - "J", - "8", - "J", - "4", - "5", - "8", - "9", - "10", - "6", - "8", - "3", - "8", - "5" - ] + "playerA": ["2", "A", "3", "A", "3", "K", "4", "K", "2", "Q", "2", "Q", "10", "J", "5", "J", "6", "10", "2", "9", "10", "7", "3", "9", "6", "9"], + "playerB": ["6", "A", "4", "A", "7", "K", "4", "K", "7", "Q", "7", "Q", "5", "J", "8", "J", "4", "5", "8", "9", "10", "6", "8", "3", "8", "5"] }, "expected": { "status": "finished", @@ -861,62 +230,8 @@ "description": "opposite decks", "property": "simulateGame", "input": { - "playerA": [ - "4", - "A", - "9", - "A", - "4", - "K", - "9", - "K", - "6", - "Q", - "8", - "Q", - "8", - "J", - "10", - "J", - "9", - "8", - "4", - "6", - "3", - "6", - "5", - "2", - "4", - "3" - ], - "playerB": [ - "10", - "7", - "3", - "2", - "9", - "2", - "7", - "8", - "7", - "5", - "J", - "7", - "J", - "10", - "Q", - "10", - "Q", - "3", - "K", - "5", - "K", - "6", - "A", - "2", - "A", - "5" - ] + "playerA": ["4", "A", "9", "A", "4", "K", "9", "K", "6", "Q", "8", "Q", "8", "J", "10", "J", "9", "8", "4", "6", "3", "6", "5", "2", "4", "3"], + "playerB": ["10", "7", "3", "2", "9", "2", "7", "8", "7", "5", "J", "7", "J", "10", "Q", "10", "Q", "3", "K", "5", "K", "6", "A", "2", "A", "5"] }, "expected": { "status": "finished", @@ -929,62 +244,8 @@ "description": "random decks #1", "property": "simulateGame", "input": { - "playerA": [ - "K", - "10", - "9", - "8", - "J", - "8", - "6", - "9", - "7", - "A", - "K", - "5", - "4", - "4", - "J", - "5", - "J", - "4", - "3", - "5", - "8", - "6", - "7", - "7", - "4", - "9" - ], - "playerB": [ - "6", - "3", - "K", - "A", - "Q", - "10", - "A", - "2", - "Q", - "8", - "2", - "10", - "10", - "2", - "Q", - "3", - "K", - "9", - "7", - "A", - "3", - "Q", - "5", - "J", - "2", - "6" - ] + "playerA": ["K", "10", "9", "8", "J", "8", "6", "9", "7", "A", "K", "5", "4", "4", "J", "5", "J", "4", "3", "5", "8", "6", "7", "7", "4", "9"], + "playerB": ["6", "3", "K", "A", "Q", "10", "A", "2", "Q", "8", "2", "10", "10", "2", "Q", "3", "K", "9", "7", "A", "3", "Q", "5", "J", "2", "6"] }, "expected": { "status": "finished", @@ -997,62 +258,8 @@ "description": "random decks #2", "property": "simulateGame", "input": { - "playerA": [ - "8", - "A", - "4", - "8", - "5", - "Q", - "J", - "2", - "6", - "2", - "9", - "7", - "K", - "A", - "8", - "10", - "K", - "8", - "10", - "9", - "K", - "6", - "7", - "3", - "K", - "9" - ], - "playerB": [ - "10", - "5", - "2", - "6", - "Q", - "J", - "A", - "9", - "5", - "5", - "3", - "7", - "3", - "J", - "A", - "2", - "Q", - "3", - "J", - "Q", - "4", - "10", - "4", - "7", - "4", - "6" - ] + "playerA": ["8", "A", "4", "8", "5", "Q", "J", "2", "6", "2", "9", "7", "K", "A", "8", "10", "K", "8", "10", "9", "K", "6", "7", "3", "K", "9"], + "playerB": ["10", "5", "2", "6", "Q", "J", "A", "9", "5", "5", "3", "7", "3", "J", "A", "2", "Q", "3", "J", "Q", "4", "10", "4", "7", "4", "6"] }, "expected": { "status": "finished", @@ -1065,62 +272,8 @@ "description": "Kleber 1999", "property": "simulateGame", "input": { - "playerA": [ - "4", - "8", - "9", - "J", - "Q", - "8", - "5", - "5", - "K", - "2", - "A", - "9", - "8", - "5", - "10", - "A", - "4", - "J", - "3", - "K", - "6", - "9", - "2", - "Q", - "K", - "7" - ], - "playerB": [ - "10", - "J", - "3", - "2", - "4", - "10", - "4", - "7", - "5", - "3", - "6", - "6", - "7", - "A", - "J", - "Q", - "A", - "7", - "2", - "10", - "3", - "K", - "9", - "6", - "8", - "Q" - ] + "playerA": ["4", "8", "9", "J", "Q", "8", "5", "5", "K", "2", "A", "9", "8", "5", "10", "A", "4", "J", "3", "K", "6", "9", "2", "Q", "K", "7"], + "playerB": ["10", "J", "3", "2", "4", "10", "4", "7", "5", "3", "6", "6", "7", "A", "J", "Q", "A", "7", "2", "10", "3", "K", "9", "6", "8", "Q"] }, "expected": { "status": "finished", @@ -1133,62 +286,8 @@ "description": "Collins 2006", "property": "simulateGame", "input": { - "playerA": [ - "A", - "8", - "Q", - "K", - "9", - "10", - "3", - "7", - "4", - "2", - "Q", - "3", - "2", - "10", - "9", - "K", - "A", - "8", - "7", - "7", - "4", - "5", - "J", - "9", - "2", - "10" - ], - "playerB": [ - "4", - "J", - "A", - "K", - "8", - "5", - "6", - "6", - "A", - "6", - "5", - "Q", - "4", - "6", - "10", - "8", - "J", - "2", - "5", - "7", - "Q", - "J", - "3", - "3", - "K", - "9" - ] + "playerA": ["A", "8", "Q", "K", "9", "10", "3", "7", "4", "2", "Q", "3", "2", "10", "9", "K", "A", "8", "7", "7", "4", "5", "J", "9", "2", "10"], + "playerB": ["4", "J", "A", "K", "8", "5", "6", "6", "A", "6", "5", "Q", "4", "6", "10", "8", "J", "2", "5", "7", "Q", "J", "3", "3", "K", "9"] }, "expected": { "status": "finished", @@ -1201,62 +300,8 @@ "description": "Mann and Wu 2007", "property": "simulateGame", "input": { - "playerA": [ - "K", - "2", - "K", - "K", - "3", - "3", - "6", - "10", - "K", - "6", - "A", - "2", - "5", - "5", - "7", - "9", - "J", - "A", - "A", - "3", - "4", - "Q", - "4", - "8", - "J", - "6" - ], - "playerB": [ - "4", - "5", - "2", - "Q", - "7", - "9", - "9", - "Q", - "7", - "J", - "9", - "8", - "10", - "3", - "10", - "J", - "4", - "10", - "8", - "6", - "8", - "7", - "A", - "Q", - "5", - "2" - ] + "playerA": ["K", "2", "K", "K", "3", "3", "6", "10", "K", "6", "A", "2", "5", "5", "7", "9", "J", "A", "A", "3", "4", "Q", "4", "8", "J", "6"], + "playerB": ["4", "5", "2", "Q", "7", "9", "9", "Q", "7", "J", "9", "8", "10", "3", "10", "J", "4", "10", "8", "6", "8", "7", "A", "Q", "5", "2"] }, "expected": { "status": "finished", @@ -1269,62 +314,8 @@ "description": "Nessler 2012", "property": "simulateGame", "input": { - "playerA": [ - "10", - "3", - "6", - "7", - "Q", - "2", - "9", - "8", - "2", - "8", - "4", - "A", - "10", - "6", - "K", - "2", - "10", - "A", - "5", - "A", - "2", - "4", - "Q", - "J", - "K", - "4" - ], - "playerB": [ - "10", - "Q", - "4", - "6", - "J", - "9", - "3", - "J", - "9", - "3", - "3", - "Q", - "K", - "5", - "9", - "5", - "K", - "6", - "5", - "7", - "8", - "J", - "A", - "7", - "8", - "7" - ] + "playerA": ["10", "3", "6", "7", "Q", "2", "9", "8", "2", "8", "4", "A", "10", "6", "K", "2", "10", "A", "5", "A", "2", "4", "Q", "J", "K", "4"], + "playerB": ["10", "Q", "4", "6", "J", "9", "3", "J", "9", "3", "3", "Q", "K", "5", "9", "5", "K", "6", "5", "7", "8", "J", "A", "7", "8", "7"] }, "expected": { "status": "finished", @@ -1337,62 +328,8 @@ "description": "Anderson 2013", "property": "simulateGame", "input": { - "playerA": [ - "6", - "7", - "A", - "3", - "Q", - "3", - "5", - "J", - "3", - "2", - "J", - "7", - "4", - "5", - "Q", - "10", - "5", - "A", - "J", - "2", - "K", - "8", - "9", - "9", - "K", - "3" - ], - "playerB": [ - "4", - "J", - "6", - "9", - "8", - "5", - "10", - "7", - "9", - "Q", - "2", - "7", - "10", - "8", - "4", - "10", - "A", - "6", - "4", - "A", - "6", - "8", - "Q", - "K", - "K", - "2" - ] + "playerA": ["6", "7", "A", "3", "Q", "3", "5", "J", "3", "2", "J", "7", "4", "5", "Q", "10", "5", "A", "J", "2", "K", "8", "9", "9", "K", "3"], + "playerB": ["4", "J", "6", "9", "8", "5", "10", "7", "9", "Q", "2", "7", "10", "8", "4", "10", "A", "6", "4", "A", "6", "8", "Q", "K", "K", "2"] }, "expected": { "status": "finished", @@ -1405,62 +342,8 @@ "description": "Rucklidge 2014", "property": "simulateGame", "input": { - "playerA": [ - "8", - "J", - "2", - "9", - "4", - "4", - "5", - "8", - "Q", - "3", - "9", - "3", - "6", - "2", - "8", - "A", - "A", - "A", - "9", - "4", - "7", - "2", - "5", - "Q", - "Q", - "3" - ], - "playerB": [ - "K", - "7", - "10", - "6", - "3", - "J", - "A", - "7", - "6", - "5", - "5", - "8", - "10", - "9", - "10", - "4", - "2", - "7", - "K", - "Q", - "10", - "K", - "6", - "J", - "J", - "K" - ] + "playerA": ["8", "J", "2", "9", "4", "4", "5", "8", "Q", "3", "9", "3", "6", "2", "8", "A", "A", "A", "9", "4", "7", "2", "5", "Q", "Q", "3"], + "playerB": ["K", "7", "10", "6", "3", "J", "A", "7", "6", "5", "5", "8", "10", "9", "10", "4", "2", "7", "K", "Q", "10", "K", "6", "J", "J", "K"] }, "expected": { "status": "finished", @@ -1473,62 +356,8 @@ "description": "Nessler 2021", "property": "simulateGame", "input": { - "playerA": [ - "7", - "2", - "3", - "4", - "K", - "9", - "6", - "10", - "A", - "8", - "9", - "Q", - "7", - "A", - "4", - "8", - "J", - "J", - "A", - "4", - "3", - "2", - "5", - "6", - "6", - "J" - ], - "playerB": [ - "3", - "10", - "8", - "9", - "8", - "K", - "K", - "2", - "5", - "5", - "7", - "6", - "4", - "3", - "5", - "7", - "A", - "9", - "J", - "K", - "2", - "Q", - "10", - "Q", - "10", - "Q" - ] + "playerA": ["7", "2", "3", "4", "K", "9", "6", "10", "A", "8", "9", "Q", "7", "A", "4", "8", "J", "J", "A", "4", "3", "2", "5", "6", "6", "J"], + "playerB": ["3", "10", "8", "9", "8", "K", "K", "2", "5", "5", "7", "6", "4", "3", "5", "7", "A", "9", "J", "K", "2", "Q", "10", "Q", "10", "Q"] }, "expected": { "status": "finished", @@ -1541,62 +370,8 @@ "description": "Nessler 2022", "property": "simulateGame", "input": { - "playerA": [ - "2", - "10", - "10", - "A", - "J", - "3", - "8", - "Q", - "2", - "5", - "5", - "5", - "9", - "2", - "4", - "3", - "10", - "Q", - "A", - "K", - "Q", - "J", - "J", - "9", - "Q", - "K" - ], - "playerB": [ - "10", - "7", - "6", - "3", - "6", - "A", - "8", - "9", - "4", - "3", - "K", - "J", - "6", - "K", - "4", - "9", - "7", - "8", - "5", - "7", - "8", - "2", - "A", - "7", - "4", - "6" - ] + "playerA": ["2", "10", "10", "A", "J", "3", "8", "Q", "2", "5", "5", "5", "9", "2", "4", "3", "10", "Q", "A", "K", "Q", "J", "J", "9", "Q", "K"], + "playerB": ["10", "7", "6", "3", "6", "A", "8", "9", "4", "3", "K", "J", "6", "K", "4", "9", "7", "8", "5", "7", "8", "2", "A", "7", "4", "6"] }, "expected": { "status": "finished", @@ -1609,62 +384,8 @@ "description": "Casella 2024, first infinite game found", "property": "simulateGame", "input": { - "playerA": [ - "2", - "8", - "4", - "K", - "5", - "2", - "3", - "Q", - "6", - "K", - "Q", - "A", - "J", - "3", - "5", - "9", - "8", - "3", - "A", - "A", - "J", - "4", - "4", - "J", - "7", - "5" - ], - "playerB": [ - "7", - "7", - "8", - "6", - "10", - "10", - "6", - "10", - "7", - "2", - "Q", - "6", - "3", - "2", - "4", - "K", - "Q", - "10", - "J", - "5", - "9", - "8", - "9", - "9", - "K", - "A" - ] + "playerA": ["2", "8", "4", "K", "5", "2", "3", "Q", "6", "K", "Q", "A", "J", "3", "5", "9", "8", "3", "A", "A", "J", "4", "4", "J", "7", "5"], + "playerB": ["7", "7", "8", "6", "10", "10", "6", "10", "7", "2", "Q", "6", "3", "2", "4", "K", "Q", "10", "J", "5", "9", "8", "9", "9", "K", "A"] }, "expected": { "status": "loop", From 8f6f0a6f95e48070e483c1a8fd4b81427395ffa0 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sat, 6 Sep 2025 00:44:44 +0200 Subject: [PATCH 64/79] fix array json CI #2 --- exercises/camicia/canonical-data.json | 1237 ++++++++++++++++++++++++- 1 file changed, 1205 insertions(+), 32 deletions(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index 96aacef0f2..aa6ee48fd3 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -118,8 +118,371 @@ "description": "the story is starting to get a bit complicated", "property": "simulateGame", "input": { - "playerA": ["2", "6", "6", "J", "4", "K", "Q", "10", "K", "J", "Q", "2", "3", "K", "5", "6", "Q", "Q", "A", "A", "6", "9", "K", "A", "8", "K", "2", "A", "9", "A", "Q", "4", "K", "K", "K", "3", "5", "K", "8", "Q", "3", "Q", "7", "J", "K", "J", "9", "J", "3", "3", "K", "K", "Q", "A", "K", "7", "10", "A", "Q", "7", "10", "J", "4", "5", "J", "9", "10", "Q", "J", "J", "K", "6", "10", "J", "6", "Q", "J", "5", "J", "Q", "Q", "8", "3", "8", "A", "2", "6", "9", "K", "7", "J", "K", "K", "8", "K", "Q", "6", "10", "J", "10", "J", "Q", "J", "10", "3", "8", "K", "A", "6", "9", "K", "2", "A", "A", "10", "J", "6", "A", "4", "J", "A", "J", "J", "6", "2", "J", "3", "K", "2", "5", "9", "J", "9", "6", "K", "A", "5", "Q", "J", "2", "Q", "K", "A", "3", "K", "J", "K", "2", "5", "6", "Q", "J", "Q", "Q", "J", "2", "J", "9", "Q", "7", "7", "A", "Q", "7", "Q", "J", "K", "J", "A", "7", "7", "8", "Q", "10", "J", "10", "J", "J", "9", "2", "A", "2"], - "playerB": ["7", "2", "10", "K", "8", "2", "J", "9", "A", "5", "6", "J", "Q", "6", "K", "6", "5", "A", "4", "Q", "7", "J", "7", "10", "2", "Q", "8", "2", "2", "K", "J", "A", "5", "5", "A", "4", "Q", "6", "Q", "K", "10", "8", "Q", "2", "10", "J", "A", "Q", "8", "Q", "Q", "J", "J", "A", "A", "9", "10", "J", "K", "4", "Q", "10", "10", "J", "K", "10", "2", "J", "7", "A", "K", "K", "J", "A", "J", "10", "8", "K", "A", "7", "Q", "Q", "J", "3", "Q", "4", "A", "3", "A", "Q", "Q", "Q", "5", "4", "K", "J", "10", "A", "Q", "J", "6", "J", "A", "10", "A", "5", "8", "3", "K", "5", "9", "Q", "8", "7", "7", "J", "7", "Q", "Q", "Q", "A", "7", "8", "9", "A", "Q", "A", "K", "8", "A", "A", "J", "8", "4", "8", "K", "J", "A", "10", "Q", "8", "J", "8", "6", "10", "Q", "J", "J", "A", "A", "J", "5", "Q", "6", "J", "K", "Q", "8", "K", "4", "Q", "Q", "6", "J", "K", "4", "7", "J", "J", "9", "9", "A", "Q", "Q", "K", "A", "6", "5", "K"] + "playerA": [ + "2", + "6", + "6", + "J", + "4", + "K", + "Q", + "10", + "K", + "J", + "Q", + "2", + "3", + "K", + "5", + "6", + "Q", + "Q", + "A", + "A", + "6", + "9", + "K", + "A", + "8", + "K", + "2", + "A", + "9", + "A", + "Q", + "4", + "K", + "K", + "K", + "3", + "5", + "K", + "8", + "Q", + "3", + "Q", + "7", + "J", + "K", + "J", + "9", + "J", + "3", + "3", + "K", + "K", + "Q", + "A", + "K", + "7", + "10", + "A", + "Q", + "7", + "10", + "J", + "4", + "5", + "J", + "9", + "10", + "Q", + "J", + "J", + "K", + "6", + "10", + "J", + "6", + "Q", + "J", + "5", + "J", + "Q", + "Q", + "8", + "3", + "8", + "A", + "2", + "6", + "9", + "K", + "7", + "J", + "K", + "K", + "8", + "K", + "Q", + "6", + "10", + "J", + "10", + "J", + "Q", + "J", + "10", + "3", + "8", + "K", + "A", + "6", + "9", + "K", + "2", + "A", + "A", + "10", + "J", + "6", + "A", + "4", + "J", + "A", + "J", + "J", + "6", + "2", + "J", + "3", + "K", + "2", + "5", + "9", + "J", + "9", + "6", + "K", + "A", + "5", + "Q", + "J", + "2", + "Q", + "K", + "A", + "3", + "K", + "J", + "K", + "2", + "5", + "6", + "Q", + "J", + "Q", + "Q", + "J", + "2", + "J", + "9", + "Q", + "7", + "7", + "A", + "Q", + "7", + "Q", + "J", + "K", + "J", + "A", + "7", + "7", + "8", + "Q", + "10", + "J", + "10", + "J", + "J", + "9", + "2", + "A", + "2" + ], + "playerB": [ + "7", + "2", + "10", + "K", + "8", + "2", + "J", + "9", + "A", + "5", + "6", + "J", + "Q", + "6", + "K", + "6", + "5", + "A", + "4", + "Q", + "7", + "J", + "7", + "10", + "2", + "Q", + "8", + "2", + "2", + "K", + "J", + "A", + "5", + "5", + "A", + "4", + "Q", + "6", + "Q", + "K", + "10", + "8", + "Q", + "2", + "10", + "J", + "A", + "Q", + "8", + "Q", + "Q", + "J", + "J", + "A", + "A", + "9", + "10", + "J", + "K", + "4", + "Q", + "10", + "10", + "J", + "K", + "10", + "2", + "J", + "7", + "A", + "K", + "K", + "J", + "A", + "J", + "10", + "8", + "K", + "A", + "7", + "Q", + "Q", + "J", + "3", + "Q", + "4", + "A", + "3", + "A", + "Q", + "Q", + "Q", + "5", + "4", + "K", + "J", + "10", + "A", + "Q", + "J", + "6", + "J", + "A", + "10", + "A", + "5", + "8", + "3", + "K", + "5", + "9", + "Q", + "8", + "7", + "7", + "J", + "7", + "Q", + "Q", + "Q", + "A", + "7", + "8", + "9", + "A", + "Q", + "A", + "K", + "8", + "A", + "A", + "J", + "8", + "4", + "8", + "K", + "J", + "A", + "10", + "Q", + "8", + "J", + "8", + "6", + "10", + "Q", + "J", + "J", + "A", + "A", + "J", + "5", + "Q", + "6", + "J", + "K", + "Q", + "8", + "K", + "4", + "Q", + "Q", + "6", + "J", + "K", + "4", + "7", + "J", + "J", + "9", + "9", + "A", + "Q", + "Q", + "K", + "A", + "6", + "5", + "K" + ] }, "expected": { "status": "finished", @@ -188,8 +551,62 @@ "description": "easy card combination", "property": "simulateGame", "input": { - "playerA": ["4", "8", "7", "5", "4", "10", "3", "9", "7", "3", "10", "10", "6", "8", "2", "8", "5", "4", "5", "9", "6", "5", "2", "8", "10", "9"], - "playerB": ["6", "9", "4", "7", "2", "2", "3", "6", "7", "3", "A", "A", "A", "A", "K", "K", "K", "K", "Q", "Q", "Q", "Q", "J", "J", "J", "J"] + "playerA": [ + "4", + "8", + "7", + "5", + "4", + "10", + "3", + "9", + "7", + "3", + "10", + "10", + "6", + "8", + "2", + "8", + "5", + "4", + "5", + "9", + "6", + "5", + "2", + "8", + "10", + "9" + ], + "playerB": [ + "6", + "9", + "4", + "7", + "2", + "2", + "3", + "6", + "7", + "3", + "A", + "A", + "A", + "A", + "K", + "K", + "K", + "K", + "Q", + "Q", + "Q", + "Q", + "J", + "J", + "J", + "J" + ] }, "expected": { "status": "finished", @@ -202,8 +619,62 @@ "description": "easy card combination, inverted decks", "property": "simulateGame", "input": { - "playerA": ["3", "3", "5", "7", "3", "2", "10", "7", "6", "7", "A", "A", "A", "A", "K", "K", "K", "K", "Q", "Q", "Q", "Q", "J", "J", "J", "J"], - "playerB": ["5", "10", "8", "2", "6", "7", "2", "4", "9", "2", "6", "10", "10", "5", "4", "8", "4", "8", "6", "9", "8", "5", "9", "3", "4", "9"] + "playerA": [ + "3", + "3", + "5", + "7", + "3", + "2", + "10", + "7", + "6", + "7", + "A", + "A", + "A", + "A", + "K", + "K", + "K", + "K", + "Q", + "Q", + "Q", + "Q", + "J", + "J", + "J", + "J" + ], + "playerB": [ + "5", + "10", + "8", + "2", + "6", + "7", + "2", + "4", + "9", + "2", + "6", + "10", + "10", + "5", + "4", + "8", + "4", + "8", + "6", + "9", + "8", + "5", + "9", + "3", + "4", + "9" + ] }, "expected": { "status": "finished", @@ -216,8 +687,62 @@ "description": "mirrored decks", "property": "simulateGame", "input": { - "playerA": ["2", "A", "3", "A", "3", "K", "4", "K", "2", "Q", "2", "Q", "10", "J", "5", "J", "6", "10", "2", "9", "10", "7", "3", "9", "6", "9"], - "playerB": ["6", "A", "4", "A", "7", "K", "4", "K", "7", "Q", "7", "Q", "5", "J", "8", "J", "4", "5", "8", "9", "10", "6", "8", "3", "8", "5"] + "playerA": [ + "2", + "A", + "3", + "A", + "3", + "K", + "4", + "K", + "2", + "Q", + "2", + "Q", + "10", + "J", + "5", + "J", + "6", + "10", + "2", + "9", + "10", + "7", + "3", + "9", + "6", + "9" + ], + "playerB": [ + "6", + "A", + "4", + "A", + "7", + "K", + "4", + "K", + "7", + "Q", + "7", + "Q", + "5", + "J", + "8", + "J", + "4", + "5", + "8", + "9", + "10", + "6", + "8", + "3", + "8", + "5" + ] }, "expected": { "status": "finished", @@ -230,8 +755,62 @@ "description": "opposite decks", "property": "simulateGame", "input": { - "playerA": ["4", "A", "9", "A", "4", "K", "9", "K", "6", "Q", "8", "Q", "8", "J", "10", "J", "9", "8", "4", "6", "3", "6", "5", "2", "4", "3"], - "playerB": ["10", "7", "3", "2", "9", "2", "7", "8", "7", "5", "J", "7", "J", "10", "Q", "10", "Q", "3", "K", "5", "K", "6", "A", "2", "A", "5"] + "playerA": [ + "4", + "A", + "9", + "A", + "4", + "K", + "9", + "K", + "6", + "Q", + "8", + "Q", + "8", + "J", + "10", + "J", + "9", + "8", + "4", + "6", + "3", + "6", + "5", + "2", + "4", + "3" + ], + "playerB": [ + "10", + "7", + "3", + "2", + "9", + "2", + "7", + "8", + "7", + "5", + "J", + "7", + "J", + "10", + "Q", + "10", + "Q", + "3", + "K", + "5", + "K", + "6", + "A", + "2", + "A", + "5" + ] }, "expected": { "status": "finished", @@ -244,8 +823,62 @@ "description": "random decks #1", "property": "simulateGame", "input": { - "playerA": ["K", "10", "9", "8", "J", "8", "6", "9", "7", "A", "K", "5", "4", "4", "J", "5", "J", "4", "3", "5", "8", "6", "7", "7", "4", "9"], - "playerB": ["6", "3", "K", "A", "Q", "10", "A", "2", "Q", "8", "2", "10", "10", "2", "Q", "3", "K", "9", "7", "A", "3", "Q", "5", "J", "2", "6"] + "playerA": [ + "K", + "10", + "9", + "8", + "J", + "8", + "6", + "9", + "7", + "A", + "K", + "5", + "4", + "4", + "J", + "5", + "J", + "4", + "3", + "5", + "8", + "6", + "7", + "7", + "4", + "9" + ], + "playerB": [ + "6", + "3", + "K", + "A", + "Q", + "10", + "A", + "2", + "Q", + "8", + "2", + "10", + "10", + "2", + "Q", + "3", + "K", + "9", + "7", + "A", + "3", + "Q", + "5", + "J", + "2", + "6" + ] }, "expected": { "status": "finished", @@ -258,8 +891,62 @@ "description": "random decks #2", "property": "simulateGame", "input": { - "playerA": ["8", "A", "4", "8", "5", "Q", "J", "2", "6", "2", "9", "7", "K", "A", "8", "10", "K", "8", "10", "9", "K", "6", "7", "3", "K", "9"], - "playerB": ["10", "5", "2", "6", "Q", "J", "A", "9", "5", "5", "3", "7", "3", "J", "A", "2", "Q", "3", "J", "Q", "4", "10", "4", "7", "4", "6"] + "playerA": [ + "8", + "A", + "4", + "8", + "5", + "Q", + "J", + "2", + "6", + "2", + "9", + "7", + "K", + "A", + "8", + "10", + "K", + "8", + "10", + "9", + "K", + "6", + "7", + "3", + "K", + "9" + ], + "playerB": [ + "10", + "5", + "2", + "6", + "Q", + "J", + "A", + "9", + "5", + "5", + "3", + "7", + "3", + "J", + "A", + "2", + "Q", + "3", + "J", + "Q", + "4", + "10", + "4", + "7", + "4", + "6" + ] }, "expected": { "status": "finished", @@ -272,8 +959,62 @@ "description": "Kleber 1999", "property": "simulateGame", "input": { - "playerA": ["4", "8", "9", "J", "Q", "8", "5", "5", "K", "2", "A", "9", "8", "5", "10", "A", "4", "J", "3", "K", "6", "9", "2", "Q", "K", "7"], - "playerB": ["10", "J", "3", "2", "4", "10", "4", "7", "5", "3", "6", "6", "7", "A", "J", "Q", "A", "7", "2", "10", "3", "K", "9", "6", "8", "Q"] + "playerA": [ + "4", + "8", + "9", + "J", + "Q", + "8", + "5", + "5", + "K", + "2", + "A", + "9", + "8", + "5", + "10", + "A", + "4", + "J", + "3", + "K", + "6", + "9", + "2", + "Q", + "K", + "7" + ], + "playerB": [ + "10", + "J", + "3", + "2", + "4", + "10", + "4", + "7", + "5", + "3", + "6", + "6", + "7", + "A", + "J", + "Q", + "A", + "7", + "2", + "10", + "3", + "K", + "9", + "6", + "8", + "Q" + ] }, "expected": { "status": "finished", @@ -286,8 +1027,62 @@ "description": "Collins 2006", "property": "simulateGame", "input": { - "playerA": ["A", "8", "Q", "K", "9", "10", "3", "7", "4", "2", "Q", "3", "2", "10", "9", "K", "A", "8", "7", "7", "4", "5", "J", "9", "2", "10"], - "playerB": ["4", "J", "A", "K", "8", "5", "6", "6", "A", "6", "5", "Q", "4", "6", "10", "8", "J", "2", "5", "7", "Q", "J", "3", "3", "K", "9"] + "playerA": [ + "A", + "8", + "Q", + "K", + "9", + "10", + "3", + "7", + "4", + "2", + "Q", + "3", + "2", + "10", + "9", + "K", + "A", + "8", + "7", + "7", + "4", + "5", + "J", + "9", + "2", + "10" + ], + "playerB": [ + "4", + "J", + "A", + "K", + "8", + "5", + "6", + "6", + "A", + "6", + "5", + "Q", + "4", + "6", + "10", + "8", + "J", + "2", + "5", + "7", + "Q", + "J", + "3", + "3", + "K", + "9" + ] }, "expected": { "status": "finished", @@ -300,8 +1095,62 @@ "description": "Mann and Wu 2007", "property": "simulateGame", "input": { - "playerA": ["K", "2", "K", "K", "3", "3", "6", "10", "K", "6", "A", "2", "5", "5", "7", "9", "J", "A", "A", "3", "4", "Q", "4", "8", "J", "6"], - "playerB": ["4", "5", "2", "Q", "7", "9", "9", "Q", "7", "J", "9", "8", "10", "3", "10", "J", "4", "10", "8", "6", "8", "7", "A", "Q", "5", "2"] + "playerA": [ + "K", + "2", + "K", + "K", + "3", + "3", + "6", + "10", + "K", + "6", + "A", + "2", + "5", + "5", + "7", + "9", + "J", + "A", + "A", + "3", + "4", + "Q", + "4", + "8", + "J", + "6" + ], + "playerB": [ + "4", + "5", + "2", + "Q", + "7", + "9", + "9", + "Q", + "7", + "J", + "9", + "8", + "10", + "3", + "10", + "J", + "4", + "10", + "8", + "6", + "8", + "7", + "A", + "Q", + "5", + "2" + ] }, "expected": { "status": "finished", @@ -314,8 +1163,62 @@ "description": "Nessler 2012", "property": "simulateGame", "input": { - "playerA": ["10", "3", "6", "7", "Q", "2", "9", "8", "2", "8", "4", "A", "10", "6", "K", "2", "10", "A", "5", "A", "2", "4", "Q", "J", "K", "4"], - "playerB": ["10", "Q", "4", "6", "J", "9", "3", "J", "9", "3", "3", "Q", "K", "5", "9", "5", "K", "6", "5", "7", "8", "J", "A", "7", "8", "7"] + "playerA": [ + "10", + "3", + "6", + "7", + "Q", + "2", + "9", + "8", + "2", + "8", + "4", + "A", + "10", + "6", + "K", + "2", + "10", + "A", + "5", + "A", + "2", + "4", + "Q", + "J", + "K", + "4" + ], + "playerB": [ + "10", + "Q", + "4", + "6", + "J", + "9", + "3", + "J", + "9", + "3", + "3", + "Q", + "K", + "5", + "9", + "5", + "K", + "6", + "5", + "7", + "8", + "J", + "A", + "7", + "8", + "7" + ] }, "expected": { "status": "finished", @@ -328,8 +1231,62 @@ "description": "Anderson 2013", "property": "simulateGame", "input": { - "playerA": ["6", "7", "A", "3", "Q", "3", "5", "J", "3", "2", "J", "7", "4", "5", "Q", "10", "5", "A", "J", "2", "K", "8", "9", "9", "K", "3"], - "playerB": ["4", "J", "6", "9", "8", "5", "10", "7", "9", "Q", "2", "7", "10", "8", "4", "10", "A", "6", "4", "A", "6", "8", "Q", "K", "K", "2"] + "playerA": [ + "6", + "7", + "A", + "3", + "Q", + "3", + "5", + "J", + "3", + "2", + "J", + "7", + "4", + "5", + "Q", + "10", + "5", + "A", + "J", + "2", + "K", + "8", + "9", + "9", + "K", + "3" + ], + "playerB": [ + "4", + "J", + "6", + "9", + "8", + "5", + "10", + "7", + "9", + "Q", + "2", + "7", + "10", + "8", + "4", + "10", + "A", + "6", + "4", + "A", + "6", + "8", + "Q", + "K", + "K", + "2" + ] }, "expected": { "status": "finished", @@ -342,8 +1299,62 @@ "description": "Rucklidge 2014", "property": "simulateGame", "input": { - "playerA": ["8", "J", "2", "9", "4", "4", "5", "8", "Q", "3", "9", "3", "6", "2", "8", "A", "A", "A", "9", "4", "7", "2", "5", "Q", "Q", "3"], - "playerB": ["K", "7", "10", "6", "3", "J", "A", "7", "6", "5", "5", "8", "10", "9", "10", "4", "2", "7", "K", "Q", "10", "K", "6", "J", "J", "K"] + "playerA": [ + "8", + "J", + "2", + "9", + "4", + "4", + "5", + "8", + "Q", + "3", + "9", + "3", + "6", + "2", + "8", + "A", + "A", + "A", + "9", + "4", + "7", + "2", + "5", + "Q", + "Q", + "3" + ], + "playerB": [ + "K", + "7", + "10", + "6", + "3", + "J", + "A", + "7", + "6", + "5", + "5", + "8", + "10", + "9", + "10", + "4", + "2", + "7", + "K", + "Q", + "10", + "K", + "6", + "J", + "J", + "K" + ] }, "expected": { "status": "finished", @@ -356,8 +1367,62 @@ "description": "Nessler 2021", "property": "simulateGame", "input": { - "playerA": ["7", "2", "3", "4", "K", "9", "6", "10", "A", "8", "9", "Q", "7", "A", "4", "8", "J", "J", "A", "4", "3", "2", "5", "6", "6", "J"], - "playerB": ["3", "10", "8", "9", "8", "K", "K", "2", "5", "5", "7", "6", "4", "3", "5", "7", "A", "9", "J", "K", "2", "Q", "10", "Q", "10", "Q"] + "playerA": [ + "7", + "2", + "3", + "4", + "K", + "9", + "6", + "10", + "A", + "8", + "9", + "Q", + "7", + "A", + "4", + "8", + "J", + "J", + "A", + "4", + "3", + "2", + "5", + "6", + "6", + "J" + ], + "playerB": [ + "3", + "10", + "8", + "9", + "8", + "K", + "K", + "2", + "5", + "5", + "7", + "6", + "4", + "3", + "5", + "7", + "A", + "9", + "J", + "K", + "2", + "Q", + "10", + "Q", + "10", + "Q" + ] }, "expected": { "status": "finished", @@ -370,8 +1435,62 @@ "description": "Nessler 2022", "property": "simulateGame", "input": { - "playerA": ["2", "10", "10", "A", "J", "3", "8", "Q", "2", "5", "5", "5", "9", "2", "4", "3", "10", "Q", "A", "K", "Q", "J", "J", "9", "Q", "K"], - "playerB": ["10", "7", "6", "3", "6", "A", "8", "9", "4", "3", "K", "J", "6", "K", "4", "9", "7", "8", "5", "7", "8", "2", "A", "7", "4", "6"] + "playerA": [ + "2", + "10", + "10", + "A", + "J", + "3", + "8", + "Q", + "2", + "5", + "5", + "5", + "9", + "2", + "4", + "3", + "10", + "Q", + "A", + "K", + "Q", + "J", + "J", + "9", + "Q", + "K" + ], + "playerB": [ + "10", + "7", + "6", + "3", + "6", + "A", + "8", + "9", + "4", + "3", + "K", + "J", + "6", + "K", + "4", + "9", + "7", + "8", + "5", + "7", + "8", + "2", + "A", + "7", + "4", + "6" + ] }, "expected": { "status": "finished", @@ -384,8 +1503,62 @@ "description": "Casella 2024, first infinite game found", "property": "simulateGame", "input": { - "playerA": ["2", "8", "4", "K", "5", "2", "3", "Q", "6", "K", "Q", "A", "J", "3", "5", "9", "8", "3", "A", "A", "J", "4", "4", "J", "7", "5"], - "playerB": ["7", "7", "8", "6", "10", "10", "6", "10", "7", "2", "Q", "6", "3", "2", "4", "K", "Q", "10", "J", "5", "9", "8", "9", "9", "K", "A"] + "playerA": [ + "2", + "8", + "4", + "K", + "5", + "2", + "3", + "Q", + "6", + "K", + "Q", + "A", + "J", + "3", + "5", + "9", + "8", + "3", + "A", + "A", + "J", + "4", + "4", + "J", + "7", + "5" + ], + "playerB": [ + "7", + "7", + "8", + "6", + "10", + "10", + "6", + "10", + "7", + "2", + "Q", + "6", + "3", + "2", + "4", + "K", + "Q", + "10", + "J", + "5", + "9", + "8", + "9", + "9", + "K", + "A" + ] }, "expected": { "status": "loop", From 20d6dd52a82cd1e4d7ccf3274e6140b83b6118b3 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:17:48 +0200 Subject: [PATCH 65/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index c407a2107c..e14edb4e93 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -7,7 +7,7 @@ Your program will receive the initial configuration of two players' decks and mu - The deck is split between **two players**. The player's cards are read from left to right, where the leftmost card is the top of the deck. -- A round consists of both players playing at least one card/turn. +- A round consists of both players playing at least one card. - Players take a turn by placing the **top card** of their deck onto a central pile. - If the card is a **number card** (2-10), play simply passes to the other player. - If the card is a **payment card**, a penalty must be paid: From 410d1a5d2778c0da600b42cd87f9503595ed503a Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:20:40 +0200 Subject: [PATCH 66/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index e14edb4e93..9f369013ce 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -11,10 +11,10 @@ Your program will receive the initial configuration of two players' decks and mu - Players take a turn by placing the **top card** of their deck onto a central pile. - If the card is a **number card** (2-10), play simply passes to the other player. - If the card is a **payment card**, a penalty must be paid: - - `J` → opponent must pay 1 card - - `Q` → opponent must pay 2 cards - - `K` → opponent must pay 3 cards - - `A` → opponent must pay 4 cards + - J → opponent must pay 1 card + - Q → opponent must pay 2 cards + - K → opponent must pay 3 cards + - A → opponent must pay 4 cards - If the player paying a penalty reveals another payment card, that player stops paying the penalty. The other player must then pay a penalty based on the new payment card. - If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. From c85a598b20cad7ed417fa28ac5471380d2a2dc94 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:21:07 +0200 Subject: [PATCH 67/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 9f369013ce..aa252f85a3 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -17,7 +17,7 @@ Your program will receive the initial configuration of two players' decks and mu - A → opponent must pay 4 cards - If the player paying a penalty reveals another payment card, that player stops paying the penalty. The other player must then pay a penalty based on the new payment card. -- If the penalty is fully paid without interruption, the player who laid the **last payment card** collects the central pile and places it at the bottom of their deck. +- If the penalty is fully paid without interruption, the player who placed the **last payment card** collects the central pile and places it at the bottom of their deck. That player then starts the next round. - The moment when a player collects cards from the central pile is called a **trick**. - If a player has all the cards in their possession after a trick, the game **ends**. From b376f592e651bd3405b13ceb59be540416bbb1fb Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:21:43 +0200 Subject: [PATCH 68/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 33 ++++++++++++++++--------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index aa252f85a3..ba01e21ba9 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -28,22 +28,23 @@ Your program will receive the initial configuration of two players' decks and mu A small example of a match that ends. -| Round | Player A | Player B | Pile | Penalty Due | -| :---- | :----------- | :------------ | :------------------------- | :---------- | -| 1 | 2 A 7 8 Q 10 | 3 4 5 6 K 9 J | | - | -| 1 | A 7 8 Q 10 | 3 4 5 6 K 9 J | 2 | - | -| 1 | A 7 8 Q 10 | 4 5 6 K 9 J | 2 3 | - | -| 1 | 7 8 Q 10 | 4 5 6 K 9 J | 2 3 A | Player B: 4 | -| 1 | 7 8 Q 10 | 5 6 K 9 J | 2 3 A 4 | Player B: 3 | -| 1 | 7 8 Q 10 | 6 K 9 J | 2 3 A 4 5 | Player B: 2 | -| 1 | 7 8 Q 10 | K 9 J | 2 3 A 4 5 6 | Player B: 1 | -| 1 | 7 8 Q 10 | 9 J | 2 3 A 4 5 6 K | Player A: 3 | -| 1 | 8 Q 10 | 9 J | 2 3 A 4 5 6 K 7 | Player A: 2 | -| 1 | Q 10 | 9 J | 2 3 A 4 5 6 K 7 8 | Player A: 1 | -| 1 | 10 | 9 J | 2 3 A 4 5 6 K 7 8 Q | Player B: 2 | -| 1 | 10 | J | 2 3 A 4 5 6 K 7 8 Q 9 | Player B: 1 | -| 1 | 10 | - | 2 3 A 4 5 6 K 7 8 Q 9 J | Player A: 1 | -| 1 | - | - | 2 3 A 4 5 6 K 7 8 Q 9 J 10 | - | +| Round | Player A | Player B | Pile | Penalty Due | +| :---- | :----------- | :------------------------- | :------------------------- | :---------- | +| 1 | 2 A 7 8 Q 10 | 3 4 5 6 K 9 J | | - | +| 1 | A 7 8 Q 10 | 3 4 5 6 K 9 J | 2 | - | +| 1 | A 7 8 Q 10 | 4 5 6 K 9 J | 2 3 | - | +| 1 | 7 8 Q 10 | 4 5 6 K 9 J | 2 3 A | Player B: 4 | +| 1 | 7 8 Q 10 | 5 6 K 9 J | 2 3 A 4 | Player B: 3 | +| 1 | 7 8 Q 10 | 6 K 9 J | 2 3 A 4 5 | Player B: 2 | +| 1 | 7 8 Q 10 | K 9 J | 2 3 A 4 5 6 | Player B: 1 | +| 1 | 7 8 Q 10 | 9 J | 2 3 A 4 5 6 K | Player A: 3 | +| 1 | 8 Q 10 | 9 J | 2 3 A 4 5 6 K 7 | Player A: 2 | +| 1 | Q 10 | 9 J | 2 3 A 4 5 6 K 7 8 | Player A: 1 | +| 1 | 10 | 9 J | 2 3 A 4 5 6 K 7 8 Q | Player B: 2 | +| 1 | 10 | J | 2 3 A 4 5 6 K 7 8 Q 9 | Player B: 1 | +| 1 | 10 | - | 2 3 A 4 5 6 K 7 8 Q 9 J | Player A: 1 | +| 1 | - | - | 2 3 A 4 5 6 K 7 8 Q 9 J 10 | - | +| 2 | - | 2 3 A 4 5 6 K 7 8 Q 9 J 10 | - | - | status: "finished", cards: 13, tricks: 1 From a0a8aa69fa08825ad3b287370eb2564990b97233 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:22:13 +0200 Subject: [PATCH 69/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index ba01e21ba9..fb247a8f1a 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -21,7 +21,6 @@ Your program will receive the initial configuration of two players' decks and mu That player then starts the next round. - The moment when a player collects cards from the central pile is called a **trick**. - If a player has all the cards in their possession after a trick, the game **ends**. -- The game **ends** when one player has all the cards in their deck. - The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! ## Examples From 38e68ef748764b233e779f5df614b83f5db08657 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:22:37 +0200 Subject: [PATCH 70/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index fb247a8f1a..14a5552d45 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -21,7 +21,7 @@ Your program will receive the initial configuration of two players' decks and mu That player then starts the next round. - The moment when a player collects cards from the central pile is called a **trick**. - If a player has all the cards in their possession after a trick, the game **ends**. -- The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards! +- The game **enters a loop** as soon as the decks are identical to what they were earlier during the game, **not** counting number cards! ## Examples From 5194d7e40277b1f2f55dc1891c35a495c54f1c19 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:23:34 +0200 Subject: [PATCH 71/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 14a5552d45..8deaaee060 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -70,8 +70,7 @@ status: "loop", cards: 8, tricks: 3 ## Your Task -- Parse the two players' decks from the input. -- Simulate the game following the rules above. +- Using the input, simulate the game following the rules above. - Determine the following information regarding the game: - `status`: `"finished"` or `"loop"` - `cards`: total number of cards played throughout the game From 420da817f35aaf5e1680efabcfe56100355bc345 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:23:45 +0200 Subject: [PATCH 72/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 8deaaee060..bf4ae02c00 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -72,9 +72,9 @@ status: "loop", cards: 8, tricks: 3 - Using the input, simulate the game following the rules above. - Determine the following information regarding the game: - - `status`: `"finished"` or `"loop"` - - `cards`: total number of cards played throughout the game - - `tricks`: number of times the central pile was collected + - **Status**: `"finished"` or `"loop"` + - **Cards**: total number of cards played throughout the game + - **Tricks**: number of times the central pile was collected ~~~~exercism/advanced For those who want to take on a more exciting challenge, the hunt for other records for the longest game with an end is still open. From d36b84cee4a411aecc59dd412503c589093fa884 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:24:26 +0200 Subject: [PATCH 73/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index bf4ae02c00..a96830d430 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -19,6 +19,7 @@ Your program will receive the initial configuration of two players' decks and mu The other player must then pay a penalty based on the new payment card. - If the penalty is fully paid without interruption, the player who placed the **last payment card** collects the central pile and places it at the bottom of their deck. That player then starts the next round. +- If a player runs out of cards and is unable to play a card (either while paying a penalty or when it is their turn), the other player collects the central pile. - The moment when a player collects cards from the central pile is called a **trick**. - If a player has all the cards in their possession after a trick, the game **ends**. - The game **enters a loop** as soon as the decks are identical to what they were earlier during the game, **not** counting number cards! From 58434a98bb0661a9cccc34959da34175f8bed1dd Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sat, 6 Sep 2025 09:29:38 +0200 Subject: [PATCH 74/79] Update exercises/camicia/instructions.md --- exercises/camicia/instructions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index a96830d430..15e99b3cce 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -8,13 +8,13 @@ Your program will receive the initial configuration of two players' decks and mu - The deck is split between **two players**. The player's cards are read from left to right, where the leftmost card is the top of the deck. - A round consists of both players playing at least one card. -- Players take a turn by placing the **top card** of their deck onto a central pile. +- Players take turns placing the **top card** of their deck onto a central pile. - If the card is a **number card** (2-10), play simply passes to the other player. - If the card is a **payment card**, a penalty must be paid: - - J → opponent must pay 1 card - - Q → opponent must pay 2 cards - - K → opponent must pay 3 cards - - A → opponent must pay 4 cards + - **J** → opponent must pay 1 card + - **Q** → opponent must pay 2 cards + - **K** → opponent must pay 3 cards + - **A** → opponent must pay 4 cards - If the player paying a penalty reveals another payment card, that player stops paying the penalty. The other player must then pay a penalty based on the new payment card. - If the penalty is fully paid without interruption, the player who placed the **last payment card** collects the central pile and places it at the bottom of their deck. From 5d56e6ad2fceb0e268f235306bba72acd0720741 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Sun, 7 Sep 2025 20:22:43 +0200 Subject: [PATCH 75/79] moved first loop test up --- exercises/camicia/canonical-data.json | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/exercises/camicia/canonical-data.json b/exercises/camicia/canonical-data.json index aa6ee48fd3..976fc013bd 100644 --- a/exercises/camicia/canonical-data.json +++ b/exercises/camicia/canonical-data.json @@ -113,6 +113,20 @@ "tricks": 1 } }, + { + "uuid": "5be39bb6-1b34-4ce6-a1cd-0fcc142bb272", + "description": "simple loop with decks of 3 cards", + "property": "simulateGame", + "input": { + "playerA": ["J", "2", "3"], + "playerB": ["4", "J", "5"] + }, + "expected": { + "status": "loop", + "cards": 8, + "tricks": 3 + } + }, { "uuid": "2795dc21-0a2a-4c38-87c2-5a42e1ff15eb", "description": "the story is starting to get a bit complicated", @@ -518,20 +532,6 @@ "tricks": 4 } }, - { - "uuid": "5be39bb6-1b34-4ce6-a1cd-0fcc142bb272", - "description": "simple loop with decks of 3 cards", - "property": "simulateGame", - "input": { - "playerA": ["J", "2", "3"], - "playerB": ["4", "J", "5"] - }, - "expected": { - "status": "loop", - "cards": 8, - "tricks": 3 - } - }, { "uuid": "3107985a-f43e-486a-9ce8-db51547a9941", "description": "simple loop with decks of 4 cards", From 78aabec4a6488a97493909484e8f5722ffa05961 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 7 Sep 2025 20:40:17 +0200 Subject: [PATCH 76/79] Update exercises/camicia/instructions.md Co-authored-by: Erik Schierboom --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 15e99b3cce..4aed549be1 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -67,7 +67,7 @@ This is a small example of a match that loops. The start of round 4 matches the start of round 2. -status: "loop", cards: 8, tricks: 3 +status: `"loop"`, cards: 8, tricks: 3 ## Your Task From 552e3d1ca90f4177c9963bf50d79e5339aa7b556 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Sun, 7 Sep 2025 20:40:26 +0200 Subject: [PATCH 77/79] Update exercises/camicia/instructions.md Co-authored-by: Erik Schierboom --- exercises/camicia/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 4aed549be1..6e2f91819d 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -46,7 +46,7 @@ A small example of a match that ends. | 1 | - | - | 2 3 A 4 5 6 K 7 8 Q 9 J 10 | - | | 2 | - | 2 3 A 4 5 6 K 7 8 Q 9 J 10 | - | - | -status: "finished", cards: 13, tricks: 1 +status: `"finished"`, cards: 13, tricks: 1 This is a small example of a match that loops. From fe234fe47f178db8069ee6929d01c658ad517f36 Mon Sep 17 00:00:00 2001 From: FraSanga Date: Mon, 8 Sep 2025 09:15:27 +0200 Subject: [PATCH 78/79] improved introduction --- exercises/camicia/introduction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/camicia/introduction.md b/exercises/camicia/introduction.md index b0f6e951bd..761d8a82c5 100644 --- a/exercises/camicia/introduction.md +++ b/exercises/camicia/introduction.md @@ -4,8 +4,8 @@ One rainy afternoon, you sit at the kitchen table playing cards with your grandm The game is her take on [Camicia][bmn]. At first it feels like just another friendly match: cards slapped down, laughter across the table, the occasional victorious grin from Nonna. -But as the game drags on, something strange happens. -The pile keeps growing. +But as the game stretches on, something strange happens. +The same cards keep cycling back. You play card after card, yet the end never seems to come. You start to wonder. From 2cb4341e374a59dc2b28c8e1d184a75261397d57 Mon Sep 17 00:00:00 2001 From: Francesco Sangalli <108059916+FraSanga@users.noreply.github.com> Date: Mon, 8 Sep 2025 21:22:42 +0200 Subject: [PATCH 79/79] Update exercises/camicia/instructions.md Co-authored-by: Isaac Good --- exercises/camicia/instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/camicia/instructions.md b/exercises/camicia/instructions.md index 6e2f91819d..db62fcef27 100644 --- a/exercises/camicia/instructions.md +++ b/exercises/camicia/instructions.md @@ -66,6 +66,7 @@ This is a small example of a match that loops. | 4 | 4 5 J 2 | J 3 | - | - | The start of round 4 matches the start of round 2. +Recall, the value of the number cards does not matter. status: `"loop"`, cards: 8, tricks: 3