Noughts & Crosses
Richard Jones - rwj100
This game is written in Java. The main class file, 'swingTTT' extends JFrame. This makes it a stand-alone application.
Due to the gratuitous amount of graphics & sounds, and the interactive GUI, this game holds most of the code within the main class file. This was the most efficient way of allowing all parts of the GUI to interact together. There is also a 'Player' class, from which human & computer player objects are created.
The playing board is an array of JButtons, with an array tile[9] which holds the state of each tile on the board.
The computer players Bill & Maggie work perfectly. Both of these can be beaten however. Tony cannot be beaten.
Having looked at the java game at http://www.cs.cornell.edu/html/courses/spring-97/CS211/golden/TicTacToe/ I created a Minimax recursive algorithm to allow the Tony player to search the game tree and select a move based upon possible future outcomes. Tony places his chip on the branch containing the most losses for his opponent, so he can't be beaten.
This application comes with 6 background tunes that you can select from in-game. Simply choose a tune and click the 'Change Music' button.