Battleship game I made

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Battleship game I made

Post by Red Squirrel »

This was for an assignment, we did not really have to go THAT complicated, but it was fun anyway.

I'm not quite done it yet, probably still some bugs to debug, and I do want to try and make the AI a bit smarter, such as not choosing tiles where the two beside are taken.

Oh, and don't even bother with IE, it sucks, it can't support the css I used. Use firefox or some other decent browser.

Attachement (click to open)

Archived topic from Iceteks, old topic ID:4002, old post ID:32854
Honk if you love Jesus, text if you want to meet Him!
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

Battleship game I made

Post by Death »

Pretty neat red, but I did notice a few bugs. Computer didn't seem to place any ships in round 2. I kept going around the whole map, nearly filling it up to the max without a single hit. Either the program isn't telling the player that they've hit a ship, or the ship placement went on the fubar. At one point during round 2, I hit a 1 tile area (that had the rest of the tiles blasted away) and I suddenly won. Also, on the bigger ships, the computer kind of gave up trying to hit the ship when it had 2 spots left. Think you might need to set a flag that keeps hitting within range until the ship is sunk. Other than that, it was great fun, highly educational and destructive :evilsmile: . Also, just a suggestion if at all possible: Make the ship images links instead of the text. It's easier to click the image and place the ship rather than click the text. I managed to fool myself wondering "Why is this not working" while clicking the image. Just a suggestion though.

Archived topic from Iceteks, old topic ID:4002, old post ID:32870
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Battleship game I made

Post by Red Squirrel »

hehe well at round 2 if you won (chances are good you did lol) it only puts 1 ship since it only has enough money for that. I still need to decide what happends when the AI runs out completely, instead of making the user going nuts trying to figure out where the ships are. lol

And the AI ain't that smart yet,need to improve that part.

Archived topic from Iceteks, old topic ID:4002, old post ID:32874
Honk if you love Jesus, text if you want to meet Him!
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Battleship game I made

Post by Red Squirrel »

Updated it with a couple bug fixes.

The main bug I can't find is that when the AI places ships about 1/100 chance it will screw up placement, like not enough tiles will get marked as being a ship, but the ship counters will still be ok, so it makes it impossible to sink all the AI's ships.

Archived topic from Iceteks, old topic ID:4002, old post ID:32908
Honk if you love Jesus, text if you want to meet Him!
Locked