If you were working in a group of 3 in class yesterday, you can work in the same group. If you were working in a group of 4 or 5 then split yourself into two smaller groups or 2 or 3. I will hand back copies of your worksheets.
M:\CLASSES\CS120\Section A\lab9
directory on the
network. Make sure you can compile them and run the main
GameController
program. To implement a better
strategy for the computer
player, you will edit the decideMove
method in
the ComputerPlayer
class. You may add as many
other methods as you want to the ComputerPlayer
class to achieve subtasks (like the
findRandomEmpty
method, which performs the
subtask of finding a random empty position on the board). Do
not make changes to any of the other program files (without
asking me about it first).
lab9
directory you should also find an
UltimateComputerPlayer.class
file. This is a
compiled version of my computer player's strategy. Try
changing the runGame
method in the
GameController
class so that it uses "Ultimo"
(the UltimateComputerPlayer
) instead of your
"Computer" (the ComputerPlayer
) player. Can you
win a game against Ultimo? Try changing the
runGame
method again so that it pits Ultimo against
your Computer. (In this computer vs. computer setup, you may
want to just comment out the code that asks the human player
to enter a name.) How does Computer fare against Ultimo?
In this lab, you have programmed a primitive form of "artificial intelligence", a main branch of computer science!
Turn in your completed worksheets and a printout of your
modified ComputerPlayer
class. Also upload your
ComputerPlayer.java
file to the Viking Web.