email me at borlaj@portlandschools.org

Loading
notes previous (10/<10) submit the dump links  
 

Tic Tac Toe

 

Block 1 code (our board looks like this).

Block 4 code

 

Board group:

  • check game status (setup the board differently each time)
  • calling makeXMove (call with coordinates)
  • Running the TicTacToe applet. It will allow you to draw your board (experiment with different xo combinations).

AI Group:

  • Create a new method called Tester that will
    • Have a Board and initialize it. (in Board (or AI), set the board up differently for different outcomes)
    • Call board.printBoard()
    • Call your move method
    • Call board.printBoard() [to see effect of the move method]

TicTacToe Group:

  • You will need to write some methods for Board and AI to get it to work
    • In AI, write a method that will randomly place an O anywhere on the board
    • In Board write the following
      • gamestatus -> so if the board is full returns win or loss or tie randomly, if not full returns unfinished
      • drawBoard -> use drawString to quickly draw a simply board (grid not necessary)
      • makeXMove -> so that it places an x randomly.

 

Rubric 10 points

Each section will get 8 points individually and then 2 points as a group with the game together. (2 points games works perfectly, all pieces mesh properly)

 

Tic Tac Toe (8 points)

  • random start (1 point)
  • flow of game (6 points)
    • draws Board each time (1 point)
    • tells whos turn (1 point)
    • switches between user and comp properly (1point)
    • checks game status each time (1 point)
    • stops game and resets if game over (1 point)
    • deals w/ invalid moves correctly (1point)
  • score updates correctly (1 point)
  • code clear and indented and names properly (1 point)
  • code commented - each section clearly labelled as its purpose - (1 point)

 

 

AI class (8 points)

  • makes 1 move when called (2 points)
  • check for win, then block, then progression, then random (4 point)
  • code clear and indented and names properly (1 point)
  • code commented - each section clearly labelled as its purpose - (1 point)

Board Class (8 points)

  • draws Board nicely - looks good (2 points)
  • game status returned correctly (2 points)
  • makeXMove (2 points)
  • code clear and indented and names properly (1 point)
  • code commented - each section clearly labelled as its purpose - (1 point)