The game development process has several steps:
Examples: write down several examples showing different situations that will occur in the game. Make sure you consider all of the possiblities.
Model: decide on the model you will use for the game.
Draw handler. Show whose move it is as well as drawing the board.
Legal moves. A very important function: determine if a move is legal!
legal-move?: Game Posn -> Boolean
Support functions: we will practice function design (including writing check-expects) to make functions we will need.
get-piece: (Listof Piece) Posn -> Piece
: See notes for legal moves.is-occupied?: (Listof Piece) Posn -> Boolean
take-piece: (Listof Piece) Posn -> (Listof Piece)
Mouse handler. The logic of interacting with the pieces can be a little complex if you want all of the details.
click->board-coord: Posn -> Posn
: Convert from screen
coordinates to the board coordinates.Problem-solving tips.
exact-floor
takes in a Real
number x and puts out the greatest Integer
less than or equal to x. Plain floor
does the same thing, but
puts out a Real
.