You are on page 1of 1

Shiritori Game Pseudocode

Possible Variables
 Player word
 Last letter player word
 First letter player word
 AI word
 Last letter AI word
 First Letter AI Word
 First Round Bool

Overall concept
A shiritori game, in which there is a list of words, for the assignment periodic elements. The player
and AI must input words back and forth, where the reply must have the same first letter. As the last
letter of the previous word. You can also not use the same word twice.

The game must word universally with any inputted text file.

Possible Pseudocode
1. Cout “let’s play Shiritori”
2. Read text file line by line (each word would be put in an array I believe according to the brief)
3. Check if text file read, if not end program
4. AI randomly selects word from text file.
5. (Bool which activates at the end of the first-round loop, which dictates now compare this word
to the PC word last letter if not player wins)
6. Player CIN they’re word
7. Check if word is in text file if not AI wins
8. If word is in the list check the first character against the last character of the previous word.
9. If match loop to 4
10. If not AI wins

You might also like