Skip to content

Commit 9d8dd23

Browse files
committed
added new examples in instructions
1 parent 385fc5a commit 9d8dd23

File tree

1 file changed

+30
-20
lines changed

1 file changed

+30
-20
lines changed

exercises/camicia/instructions.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,44 @@ Your program will receive the initial configuration of two players’ decks and
2525
- The game **ends** when one player can no longer respond by playing a card, in general.
2626
- The game **enters a loop** as soon as decks identical to previous ones are played during the game, **not** counting number cards!
2727

28-
## Example
29-
30-
Here’s a simple example of input and output.
31-
32-
```json
33-
"input": {
34-
"playerA": "--------------------------",
35-
"playerB": "----------AAAAKKKKQQQQJJJJ"
36-
},
37-
"output": {
38-
"status": "finished",
39-
"cards": 40,
40-
"tricks": 4
41-
}
28+
## Examples
29+
30+
A small example of a match that ends:
31+
```
32+
Player A: "2A78Q10"
33+
Player B: "3456K9J"
34+
Pile: 2 → 3 → A → 4 → 5 → 6 → K → 7 → 8 → Q → 9 → J → 10
35+
(status: "finished", cards: 13, tricks: 1)
36+
```
37+
38+
A small example of a match that goes into a loop:
4239
```
40+
Player A: "J23"
41+
Player B: "4J5"
42+
Pile: J → 4
43+
(cards: 2, tricks: 1)
44+
45+
Player A: "23J4"
46+
Player B: "J5"
47+
Pile: 2 → J → 3
48+
(cards: 5, tricks: 2)
4349
44-
### Explanation
50+
Player A: "J4"
51+
Player B: "52J3"
52+
Pile: 5 → J → 2
53+
(cards: 8, tricks: 3)
4554
46-
- Player A only has number cards, so can never defend against a payment card.
47-
- Player B has a long sequence of payment cards: Aces, Kings, Queens, and Jacks.
48-
- 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).
49-
- 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).
55+
Player A: "45J2"
56+
Player B: "J3"
57+
Payment card configuration already viewed!
58+
(status: "loop", cards: 8, tricks: 3)
59+
```
5060

5161
## Your Task
5262

5363
- Parse the two players' decks from the input.
5464
- Simulate the game following the rules above.
55-
- Determine is the final game status is `"finished"` or `"loop"`.
65+
- Determine the following information regarding the game:
5666
- `"status"`: `"finished"` or `"loop"`
5767
- `"cards"`: total number of cards played throughout the game
5868
- `"tricks"`: number of times the central pile was collected

0 commit comments

Comments
 (0)