Artificial Intelligence - Game of Nim

11
ARTIFICIAL INTELLIGENCE Created by: Kenneth Sutton and Zach Indovino

Transcript of Artificial Intelligence - Game of Nim

Page 1: Artificial Intelligence - Game of Nim

ARTIFICIAL INTELLIGENCE

Created by: Kenneth Sutton andZach Indovino

Page 2: Artificial Intelligence - Game of Nim

Background of Project

• The goal of our project was to create the game of Nim on the computer and through trial and error, have the computer learn to eventually beat the human player every game

Page 3: Artificial Intelligence - Game of Nim

Rules of Nim

• This is a two player game in which each player takes turn picking stones from a pile

• The game starts with three piles of three stones each• On your turn, the player has the choice of taking any

number of stones, so long as you only take from one pile

• Each player must take at least one stone each turn• The player taking the last stone on the board wins!

Page 4: Artificial Intelligence - Game of Nim

How the game would look…

Page 5: Artificial Intelligence - Game of Nim

Player 1 starts

Page 6: Artificial Intelligence - Game of Nim

Player 2

Page 7: Artificial Intelligence - Game of Nim

Player 1

Page 8: Artificial Intelligence - Game of Nim

Player 2

Page 9: Artificial Intelligence - Game of Nim

Player 1 Wins

Page 10: Artificial Intelligence - Game of Nim

Our Approach

• Our first step was simply getting the computer to play the game of Nim by itself

• Secondly, we made a human player be able to play with the computer, and we added the rules of the game into the code, to prevent the adding of stones, or no move to be made at all

• Lastly we incorporated arrays into the code, so the computer would use moves that previously won it a game, to help it win more frequently

Page 11: Artificial Intelligence - Game of Nim

Using this outside of class

Although the game of Nim outside of class wont be very helpful, being able to “teach” a computer things may very well come in handy in our future careers of Electrical and Computer Engineering