SBU policy is that they own the Syllabus; other material is the property of the instructor who prepared it.
Assignments, Due Date, problems:
August 27: p.36, 1,2,5,6
September 3: p.109, 3,11,16,20
September 10: p.127, 18,21,25; p.182, 2
September 17: p.247, 4,7,20,21
October 4: p.319, 3,6,7
October 8: p.409, #5, 12; p.506, #7, 10
October 22: p.604, #3, 4, 10+11
October 31: p.683, #1, 6, 7, 9
Final: Dec.10, 8am
My Battleship program
2 PT Boat (two of these)
A. Each program begins a turn cycle by displaying its own board and whatever it knows about the opponent board, then waiting for input.
B. The input is a 3-digit number (three single digit numbers), the first digit reflecting the result of the last output, or zero if none (as with the first turn):
0=No hitThe next two digits represent the row and column for the opponent's shot. When the program gets to go first, this will also be zero on the first iteration.
2=Sunk PT Boat
C. The program will process this input, then output its response in the same format, then go back to Step A to repeat the cycle.
You are encouraged to watch the tournament play and improve your program
for the next week's tournament. Program (source code) must be submitted
by email at least 30 minutes before class in order to compete. Send your
entry to: TPittman@SBUniv.edu
Back to T.Pittman home
Rev. 2002 December 6