Battleship source for Unix w/curses

Karen Pline karen at wjvax.UUCP
Tue Mar 18 10:26:54 AEST 1986


[munch munch.....]

Regarding the Battleship Source posted to the net by Bruce:

We solved the problem with curses on BSD 4.2 by adding four short routines
to the bottom of the program - fairly simple.

Also, whenever you play the game, it thinks you're Bruce (I took care of 
that, too).

My problem, however, is with the pattern that the ships are set up in.  
The first time you play the game (every time you play it) the pattern that
the ships are in is identical.  If you stay in the game when the computer asks 
if you want to play again, a new pattern will be set up.  But every time you 
restart the game, the same patterns repeat.  So, once you play through the 
patterns without getting out of the program, you know the patterns for the 
next time you play (I hope this makes sense).  There may be something wrong 
with the random pattern generator in the program (if there is one), but I 
haven't had time to look.

If someone looks into this, please post to the net or let me know.  

Anyway, I've never posted to this group before, but I thought this was
of general interest since so many people grabbed this piece of code.

And since we're talking battleship games, we've had one on our system for a
while which also came from the net (I think).  I can't remember who
posted it, but it also has a problem.  When it searches for your ships, it
always assumes you set yours up under the same strategy it sets its own
ships up with - i.e., good possibility of adjacency.  Then, it doesn't
eliminate logically.  By this I mean that even if it hits all the ships except
the Carrier, it still looks for adjacencies or guesses randomly instead of
just looking for openings where the five holes would fit.  Needless to say,
I've never lost (and believe me, I've played more than 100 times) even
when I try to accomodate it a little bit.

				Karen Pline



More information about the Comp.sources.unix mailing list