CS 250, Spring
2017, Iyengar
Programming Project #2
Due: 3/12/2017
Objective: Create a button
based event-driven GUI to play the game Tic-Tac-Toe.
Team: If you
choose, you can work with one partner and submit one solution. Send me the name
of your partner (by Sunday end of 2-19).
·
Your application
should first display the board. A Play button should allow the user to choose two
different
·
Players’ name
(from among a list of names initially read from a file). It should then display
the chosen players name and their scores – number of wins (also part of the
read file). The first player plays X, the second player plays O.
·
The board to
should indicate the player who goes next, and a message to choose a tile. If a
tile taken is clicked then an appropriate message is displayed and the player
chooses a valid tile.
·
When a player
wins or if the game is a draw – display an appropriate message and update the
score.
·
A Replay button
allows the same players to play again. A New button allows a new game between different
players.
·
An Exit button
updates the scores to the file and exits the application.
·
Input file (scores.dat)
has the current names and scores (any number) that is initially read-in and
used.
Ex: Iyengar 21
John 52
Mary 45
Paul 65
Sarah 84
Questions and Collaboration:
Any questions about the problem – email, inquire in class or discuss
with instructor or tutor. You are free to discuss the problem solving part. Do
not view or use code developed by other (or from internet).
Export your project before the end of the due date indicated above.