Text games

Througout my Sophomore year in high school and early in my Junior year of high school, I liked to make programs that allow you to play simple games such as Hangman or Rock Paper Scissors. These are simple, fun, and easy to make.

Below, you will see the Hangman game that I wrote with Python in Sophomore year of high school. If you look closely at the code, you'll see that my comments are pretty silly. The game will also take off tries if you don't follow the instructions and input too many letters you've already used. You can run the program by clicking on the Play button above the code. When you successfully guess the word, the program prints out "Conglaturation!!!", which is a reference to an old Ghostbusters game which, when beaten, actually says "conglaturation !!! You have just beaten a great game. And prooved the justice of our culture. Now go and rest our heroes !" If you don't believe me, you can just google "conglaturation."

Another text game that I made using Python was Rock Paper Scissors. It's actually Rock Paper Scissors Lizard Spock, which is a similar concept, just more complicated. Thankfully, my former self was smart enough to not use a long string of if statements and just assigned a numerical value to each move and made win conditions for one player. These are on line 40 and the numerical values for each move are on lines 5 and 6 where they correspond to the index values of the moves in the list, so rock is 0 and paper is 2. [0,2] on line 40 corrosponds to rock and paper, which means a win for player 2. It also uses getpass to hide your input when you're playing with someone else.

The most complicated text game I made with Python is my maze game. It allows you to move within a maze searching for the O. The game is able to randomly generate a map and allows you to move around in it using WASD, where W is up, A is left, S is down and D is right. Sadly, it could be unsolvable due to the random nature of the maps generated. You can used IJKL if you get stuck somewhere, or you can press the R button when you're in the same section as the O if it's unreachable to win automatically. For some reason, the Getch function I found online doesn't work on Repl.it, which is what I'm using to embed my projects. This means you need to hit the enter button after each input. I could probably fix this, but I want each project to be the original version that I made in 10th grade, so I'll leave it as it is.

I made another text game in the beginning of junior year. This time, I wrote it in java. It works like a tile puzzle. The goal is to make the board read
123
456
78
You play the game by looking at the piece that you want to move, hitting a WASD key based on which way you want that piece to go, and then hitting enter. While it is randomized, it's always possible to solve the puzzle since all it does to scramble the board is make 150 random moves.