-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathteamLog.txt
36 lines (29 loc) · 1.2 KB
/
teamLog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Class card
Value 1-13
Suit string
Flipped bool
Deck - array of 52 cards
Shuffle the deck
Make 7 piles of cards
First pile is 7 cards
2nd is 6 and so on
Top card is flipped
Four empty piles on the side
Rest of the deck goes onto the other side
Flipped over cards can be selected
if any cards are under the selected card, they are also selected
selected cards are highlighted
when the user clicks after having selected cards
if the position is valid:
add cards to the pile
valid positions:
for the middle piles, the top card must have a value one higher than the selected card and a different colored suit, can be empty if the selected card is a king.
for the side piles, must be one higher than the card on top (ace if empty) and of the right suit corresponding to the pile.
else:
deselect cards
if the side deck is clicked:
take the top card, flip it over, add it to the top of the flipped pile directly below the deck
this card can be selected
if the side deck is empty, take the flipped card pile, reverse the order, put it back into the side deck
Once all of the side and middle piles are empty, finish the game
https://www.w3schools.com/html/default.asp