Having Conversations with Objects, and a Blast from the Past
First Year Java seems to be going OK. Expanded on the final piece of assessed work today in the lecture. My voice is back to 95 percent so I think everyone heard. We are making an "object" which will play the silly game of Battleships. In this situation it is useful to think in terms of having a conversation with the object. Each thing you say to it is a call to a method in it, we have ones for "start the new game", "I want to attack a square", "which square do you want to attack", "do you give in?" and so on.
One of the scary things was that some of the students thought that it was quite OK for the computer to hold their board as well. This is like telling your opponent where all your ships are and expecting him/her not to use that information. If I was writing a Battleships program I'm pretty sure that I'd make mine cheat if it could....... This kind of thing is another reason why you shouldn't play those "on-line casino" games which pop up on some web pages.
Oh, and if you are not sure what the game of Battleships is all about you can find out more here.
In the evening Richard came round. It was nice to see him, he left the area some time back and is headed for the 'states in a few weeks. He's the bloke who sold us the pinball table, so we fired up "La Machine" and spent a happy hour or so trying to get into the Twilight Zone. We agreed that the machine was "playing very tight" which is the Pinball Experts way of saying that we all got fairly miserable scores. In the middle of my best game I contrived to blow the fuse which controls the power to all the flippers and stuff, which caused that round to come to a premature end.
I needed 7 amp fuses, but we are making do with 6.3 amps until I can get some proper ones. This means that when a lot of stuff is happening the fuse can go pop - although this only seems to happen to me.... The other solution would be to put a 10 amp fuse in there, but this might mean I'll need a new Pinball Table if anything goes wrong.....