Connect 4
This is a two player game utilizing MATLAB as an adaptation for the classic board game, Connect 4. The object of the game is to be the first player to place four of the same colored chips in a row, whether it be horizontally, vertically, or diagonally. Before starting the game, designate one of the two players as player one, and the other as player two. Player one will go first, followed by player two, and then alternate turns placing chips into the game board. To enter a chip into the game board, simply enter a column number 1-7, with 1 being the leftmost and 7 being the rightmost column, that you would like to place your chip into the program, then press “Enter” on your keyboard. The program will do the rest from there, until a player has won, and the program displays, “You won!”
Rock Paper Scissors
This game requires one player, and the user plays against the computer. The objective of the game is to choose either rock, paper, or scissors and hope that your choice trumps the choice that the computer makes. Keep in mind that rock beats scissors, scissors beats paper, and paper beats rock. In MATLAB, you will simply enter a number, 1 for rock, 2 for paper, and 3 for scissors (or 0 to quit), and then the program will compare your input with the choice that the computer generates to see who wins! The computer also keeps a running score that is displayed at the end of the game.
Over Under Seven
Over Under Seven is a single player game that involves betting a certain amount of money on each turn. The objective of the game is to correctly guess if the sum of two die that are rolled will be less than, greater than, or equal to seven. You will start with $100 that you are able to bet. You will then be prompted to enter an amount to bet, which can range from $1 to the amount of money that you have, which is $100 on the first turn. You are then asked to enter “high” “low” or “sevens” in order to predict the value that the two die will roll. If you guess correctly, then you win the amount of money that you previously entered. If you lose, then you will lose the amount of money that you previously entered. If you correctly guess that the die would add up to seven, then you win four times the amount of money that you entered! This program will continue to run until you enter “0” on the next turn, or until you run out of money and can no longer place bets.
What are the Odds?
This game is a single player game that involves the computer generating a dare that you may or may not have to do. The computer will randomly generate a dare, such as “What are the odds that you spin around 10 times and try to walk in a straight line?” You will then be prompted to enter a number. This number will represent the odds that you have to do the dare. Then, you will be prompted to enter another number, this number will be your odds and must be between 1 and the previous number that you entered. The computer will also randomly generate a number in the same bounds that you are picking your number. If the number you entered, your odds, and the number that the computer generated, the computers odds, are the same number, then you must do the dare! If the numbers do not match, then you do not have to do the dare. You can continue playing until you enter “0” and the game will quit.