Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 91 additions & 60 deletions Game Simulation (1).txt
Original file line number Diff line number Diff line change
@@ -1,60 +1,91 @@
Turn 1:
* If all of pile’s cards are flipped over twice with no cards moved:
* Game over;
* Deal the cards;
* Look over all the cards on the field;
* if there are any aces:
* Move to the delegated pile on the side and look at flipped over cards;
* Check if any face up in the piles can be put on top of aces in sequential ascending order that also has the same suite:
* If yes, move
* Check if you can move cards between piles (moving to pile must be in descending order and must be alternating in color (i.e. black then red/red then black):
* If can, move any available cards from one pile to another;
* If there is a card under the card you move:
* Flip over the new card and see if any moves may be made to piles (same rules apply);
* Check again if any cards can be put on top of the foundations in sequential order with same suite or aces can start a foundation:
* If true, move to foundations;
* Else, next step;
* Check if you have any kings face up:
* If open pile = true, move to open pile;
* If move was from a pile:
* Flip over the card that was below the king;
* Repeat all previous processes;
* If preceding moves can be repeated:
* Continue to move until no more moves are possible;
* Flip over 3 cards from the top of the deck one at a time if there are less than 3 cards, deal as many as you can;
* Look at the top card;
* Check if the first card can be put on top of a foundation or start a foundation with an ace (Must be sequential and same suite):
* If true, move;
* Check if card can be moved to a pile:
* Moving to pile must be in descending order and must be alternating in color (i.e. black then red/red then black);
* If moved, check if the second card flipped over can be moved;
* Check for possible repeated moves;
* If not, check if first card is a king:
* If king, check if you can place it on an open pile:
* If open pile = true, move it there;
* Else, skip;
* Check for possible repeated moves;
* If first card is moved, check second face-up card:
* Repeat previous process;
* If second card is moved=true:
* Check if third card can be moved:
* If true, repeat
* If there are leftover cards (i.e. first flipped, second, or third flipped weren’t moved ):
* Place them to the bottom of the deck;
* Check if you can move cards between piles (moving to pile must be in descending order and must be alternating in color (i.e. black then red/red then black):
* If can, move any available cards from one pile to another;
* If there is a card under the card you move:
* Flip over the new card and see if any moves may be made to piles (same rules apply);
* Check again if any cards can be put on top of the foundations in sequential order with same suite or aces can start a foundation:
* If true, move to foundations;
* Else, next step;
* Check if you have any kings face up:
* If open pile = true, move to open pile;
* If move was from a pile:
* Flip over the card that was below the king;
* Repeat all previous processes;
* If preceding moves can be repeated:
* Continue to move until no more moves are possible;
* When complete, turn over;
Turn 2: Repeat Turn 1 process;
Turn 3: Repeat Turn 1 process;
//Card game isn't named in title.txt and I have no idea what game this is, so I can't really help out with instructions
//and all of the astrisks ironically make the text harder to follow
Turn 1:
//Define how many cards each player gets and etc
Deal the cards

//formatting
Look over all the cards on the field:
if there are any aces:
then move to the delegated pile on the side and look at flipped over cards

If any face up in the piles can be put on top of aces in sequential ascending order that also has the same suit:
then move

//Instead of putting () try to define what you mean
If you can move cards between piles (moving to pile must be in descending order and must be alternating in color (i.e. black then red/red then black):
then move any available cards from one pile to another:
If there is a card under the card you move:
then flip over the new card and see if any moves may be made to piles (same rules apply)

If any cards can be put on top of the foundations in sequential order with same suit or aces can start a foundation:
then move to foundations:
else : next step

If you have any kings face up:
//Could add something better than a comma to define
then open pile = true, move to open pile:
If move was from a pile:
then flip over the card that was below the king:
//Repeat until?
Repeat all previous processes

If preceding moves can be repeated:
then continue to move until no more moves are possible

Flip over 3 cards from the top of the deck one at a time:
If there are less than 3 cards:
then deal as many as you can

Look at the top card:
If the first card can be put on top of a foundation or start a foundation with an ace (Must be sequential and same suite):
then move
If card can be moved to a pile:
then moving to pile must be in descending order and must be alternating in color (i.e. black then red/red then black):
If moved:
then check if the second card flipped over can be moved:
Check for possible repeated moves:
else : check if first card is a king:
If king:
then check if you can place it on an open pile:
If open pile = true:
then move it there:
else : skip:
Check for possible repeated moves

If first card is moved, check second face-up card:
Repeat previous process;
If second card is moved = true:
Check if third card can be moved:
If true:
then repeat

If there are leftover cards (i.e. first flipped, second, or third flipped weren’t moved ):
then place them to the bottom of the deck

If you can move cards between piles (moving to pile must be in descending order and must be alternating in color (i.e. black then red/red then black):
then move any available cards from one pile to another:
If there is a card under the card you move:
then flip over the new card and see if any moves may be made to piles (same rules apply)

If any cards can be put on top of the foundations in sequential order with same suite or aces can start a foundation:
then move to foundations:
else : next step

If you have any kings face up:
then open pile = true, move to open pile:
If move was from a pile:
then flip over the card that was below the king:
Repeat all previous processes

If preceding moves can be repeated:
then continue to move until no more moves are possible

When complete, turn over

If all of pile’s cards are flipped over twice with no cards moved:
then the game is over

Turn 2: Repeat Turn 1 process

Turn 3: Repeat Turn 1 process