home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.pdx.edu
/
2014.02.ftp.ee.pdx.edu.tar
/
ftp.ee.pdx.edu
/
pub
/
users
/
Harry
/
cse509
/
hw4.txt
< prev
next >
Wrap
Text File
|
2002-03-09
|
3KB
|
97 lines
CSE 509 -- HW #4
==================
Design Due: Monday, 11 February 2002
Date Due: Monday, 18 February 2002
Goals:
- Continue exploring the graphics classes and the classes associated with
the user interface.
- Design and create your own classes.
- Design and implement a user interface of your own.
The project:
The game of tic-tac-toe (also called "noughts and crosses") is played by two
people.
Create a Smalltalk version of the game, to support / display / monitor games
played by two humans.
- The computer will display the game board on the screen.
- The user(s) will select their moves with the mouse.
- The computer will check to see that the moves are legal.
- The computer will display the moves on the screen.
- The computer will check to see whether the game is over, and will display
accordingly.
- The game will be played by two humans; the computer will not select moves
on it own.
You will need to make the following design choices:
- How exactly will the user interface work?
- Which classes will you create? Which methods?
Optional Extensions:
- Allow the computer itself to be a player, so that a single human alone can
play against the computer. This may be harder than it looks; I recommend that
you do not attempt this unless you are familiar with the game playing
algorithms (such as "min-max" or its variant, "alpha-beta search").
- Support another game. "Othello" might be a possibility since it is slightly
more complex, but still has a rectangular board with only one type of piece.
However, the rule about moves is much more complex. Othello is a nice game
for the computer, since it is tedious to play with physical pieces due to the
high piece turn-over. (Also, if the computer acts as a player, a
straightforward min-max algorithm yields a formidable opponent.)
(In brief, the players are called white and black and they alternate. The
board is 8X8. A player moves by adding a piece to the board. When a white
player moves, he "captures" all the black pieces between the new white pieces
and another white piece, but only if there are no intervening empty spaces.
For example, if this is one row of the board...
W B W B B B - -
then a move here...
W B W B B B W -
will capture the black pieces, giving this...
W B W W W W W -
Captures can happen on vertical, horizontal, and diagonal directions. Black
moves are similar. The goal is to have the most pieces when play ends.)
- Any other enhancements / modifications that you think of.
What to hand in:
Design: Hand in a hard copy paper with your name and email address on it, for
your design. Answer the following questions.
- Which classes will you have?
- Which methods will you write?
- What will the screen look like? (Hand-drawings are okay.)
- What menus / buttons will you have?
- What messages will be displayed?
Part 1: Keep all your code in a single category, file it out, and e-mail it
with subject "HW #4". Please don't submit multiple times without prior
approval.
Part 2: Hand-in a single hard copy page with your name and email address on
it. Answer the following questions:
- Did you complete the basic assignment?
- What (if any) extensions did you complete?
- How does your interface work? Make sure I will fully appreciate all the
functionality you have provided and make sure I can successfully use your
user interface.
Please keep part 2 to a single sheet of paper.