Name Last modified Size Description
Parent Directory -
dots.c 02-Dec-2004 13:19 15K
dots.h 02-Dec-2004 13:19 4.4K
dots1.jpg 02-Dec-2004 13:20 59K
dots2.jpg 02-Dec-2004 13:19 62K
dots3.jpg 02-Dec-2004 13:19 55K
schbtn.jpg 02-Dec-2004 13:19 19K
schleds.jpg 02-Dec-2004 13:19 26K
| Current Directory: | |
|---|---|
| Quick Links: |
The /unsw/projects/dots directory contains the full source of Nonie's Dots-and-Boxes game including a partial circuit diagram of the implementation.
This project was developed by Arnon Politi, in June 2004, as part of the assesment for ELEC2041 Microprocessors and Interfacing.
Nonie's Dots-and-Boxes
Dots and Boxes is a familiar pencil-and-paper game that most of us used to play as children. It starts from a square array of dots where each of the two players, in turn, has to connect any adjacent dots with a line, either horizontally or vertically. Whenever a player closes the forth side of a box he initials that box and must then play again. The game goes on until all of the boxes had been initialed and the player who initialed more boxes is declared as the winner.
This project is a hardware implementation of the game using a simple electrical circuit containing LEDs, buttons and switches and is controlled by the DSLMU Microcontroller Board.
This implementation of the game offers both the interface for playing the game and an intelligent computer player to compete against.
The hardware implementation of the game consists of an array of 40 lines (20 horizontal and 20 vertical), each reperesnted by 3 LEDs. The game is also controlled by 7 buttons (Up, Down, Left, Right, Rotate, Fix and Reset). Both the array of LEDs and the buttons are connected to the external connectors of the DSLMU board (SA/SB/VS) which allows the software to control them.
Each element in the array of lines is implemented using the following diagram:
Each one of the 7 buttons is connected using the following diagram:
The game starts with a blank board. The player to go first (human or computer) is chosen at random at the begining of each game. A little arrow on the LCD display will indicate who's turn it is during the game. When it is the human player's turn, the vertical top-left line will start blinking. Use the blue switches to move the blinking line to the desired position and press the right red button to fix it there. Use the left red button to rotate between horizontal and vertical lines. When it is the computer's turn, the line at the computer's desired position will blink 3 times and will fix afterwards.
Every time you close a box, a little smiley drawing will appear in the corresponding box on the LCD display and you will get another turn. When the computer completes a box, a little drawing of a robot will appear in the corresponding box on the LCD display and the computer will play again. Throughout the game, the score will also be displayed on the LCD display.
Once all of the boxes had been completed, the winner will be announced as a scrolling message on the LCD display. Press any button to restart the game.
At any point throughout the game, you can restart it by pressing the black RESET button found at the top-right corner of the board.
Software implementations of the Dots and Boxes game can be found at the following sites:
An excellent mathematical analysis of the game and advanced game strategies can be found in the book The Dots-and-Boxes Game: Sophisticated Child's Play by Elwyn R. Berlekamp.