Final Project (Choose 1 of the following) Max Score: A #1 - The Game of Nim The game of Nim starts with a random number of stones between 15 and 30. Two players alternate turns and on each turn may take either 1,2, or 3 stones from the pile. The player forced to take the last stone loses. Create a Nim application that allows the user to play against the computer. In this version of the game, the application generates the number of stones to begin with, the number of stones the computer takes, and the user to go first. The application interface should look similar to: Include code that prevents the user and the computer from taking an illegal number of stones. For example, neither should be allowed to take three stones when there are only 1 or 2 left. Your program should use: ValidEntry function to check the number entered by the user or computer to make sure that it is a valid # and that there are enough stones left to take. (ask for help with this if you do not understand) RandomNum function like the one we made in class to generate a random number of stones and the number that the computer guesses Separate procedures for the user s turn and the computer s turn.
#2 Mastermind Max Score: A The game of mastermind is played as follows: one player (the code-maker) chooses a secret arrangement of colored pegs and the other player (the code-breaker) tries to guess it. After each guess, the code-maker reports two numbers: 1. The number of pegs that are the correct color in the correct position. 2. The number of pegs that are the correct color regardless of whether they are in the correct position Create a Mastermind application where the computer is the code-maker and the player is the codebreaker. For simplicity, do not allow the secret arrangement of colored pegs to have duplicate colors. The application interface should look similar to: Your program should Use a ChooseColors procedure the has intpeg1color, intpeg2color, and intpeg3color parameters to generate unique colors for the secret arrangement of colored pegs. Use numbers 1 through 5 to represent colors and use RandomNum Function to generate the random numbers. Call the ChooseColors procedure from Form_Load Use a procedure called CheckColors to check for the number of correct colors Use a procedure called CorrectPegs to check to see how many pegs are in the same position
#3 Tic Tac Toe Max Score:B+ We all know the rules of Tic-Tac-Toe, so there is no need to go over them. This game of tic-tac-toe will involve two people, the user and the computer. The user will always go first and the computer will always go second. Create a tic-tac-toe game similar to the one below that will allow a person and computer to play the game and will decide who won and whether or not the game is a stalemate. The game needs to include a RandomNum Function that will decide which square the computer will choose. Have the computer choose a random number between 1 and 9 (have that correspond to a specific square). Your game also needs to include a PersonTurn Procedure, ComputerTurn procedure and a CheckGame procedure. The ComputerTurn procedure should decide where the computer is going to make its next move. The CheckGame procedure should check to see if someone has won the game.
#4 Hi Lo Game Max Score: C In the Hi-Lo Game, the player begins with a score of 1000. The player enters the number of points to risk and chooses High or Low. The player s choice of high or low is compared to a random number between 1 and 13, inclusive. If the number is between 1 and 6, it is considered Low. If it is between 8 and 13, it is considered High. The number 7 is neither high nor low, and player loses the points at risk. If the player guesses incorrectly, he or she loses the points at risk. If the player guesses correctly, he or she receives double the points at risk. Create a Hi-Low application that allows the user to enter the number points at risk and pick either High or Low and then display the result. The application interface should look similar to: Your program should include the following elements: RandomNum Function A RandomNum Function that you will use to generate a random number between 1 and 13: Private Function RandomNum(ByVal inthighnum As Integer, ByVal intlownum As Integer) as Integer StartGame Procedure A StartGame procedure that will simply set the number of points to 1000 when a new game starts. You should call this procedure in form load to start the program and whenever they press the Play Again button. Private Sub StartGame()
#5 Slot Machine Max Grade C+ We have all seen or played a slot machine before. You job in this program is to create a slot machine with at least 3 wheels of pictures that need to be matched in different combinations to win a prize. The rules are as follows 1)Choose some pictures for the slot machine 2) Determine how to score the game 3) Start the person with a set amount of points 4)Subtract points just for spinning the wheel 5) Update score correctly 6) Add the following functions/methods Private Function RndInt(ByVal intlownum as integer, ByVal inthighnum as integer) as integer Private Sub Spin() 'Randomly selects pictures to show 'Displays pictures End Sub Private Sub CheckResult() 'Checks to see if you won 'Display a message box if your won or lost 'Updates your score correctly End Sub