Hi Petr,
Just like human players, my AI tracks whether it has shot at a cell or not with the hits(x, y) array.
If the idiot player wants to shoot at the same place over and over, let him! The board is tracking his shots so not needed to tell him he being wasteful of shots.
I don't understand your question of graphics used, allot of image files are used, just check out the folder loaded with them!
(Sorry, I am in a bit of a rush...)
Append: OK I think you are asking if these image files were created by the code? No, Johnno has been my supplier of image and sound files. We've collaborated on a number of projects. I did create code to generate the fire directly under the Black Battleship in the splash screen at the beginning.
Oh also, the squares that the Player has already tried (and missed) are signaled on the game board by a lighter, whiter shade water tile. Petr, maybe you did not notice the lighter shade? I myself could not see the difference in regular water tile and a water tile signaling a miss unless the tiles were side by side. In summary, the Player's misses are signaled to the Player, even if they are not checked in code.
Hi all,
The games are running much fiercer than I expected. To count how long a game takes by how much ocean remains undisturbed by hits or misses, I added this code to 5-AI at the end of the game loop:
ahits = 0
amisses = 0
aocean = 0
ahits = ahits + 1
aocean = aocean + 1
amisses = amisses + 1
rgb 999
PRINT "AI misses ="; amisses
PRINT "Undisturbed ocean ="; aocean
I collected data from 25 games that I entered into this text file: 5-AI stats.txt attached. The first 14 items are my wins and the last 11 are the AI's wins.
I added up and averaged with this code:
'add stats
PRINT "Player win average undisturbed ocean ="; pt
/ 14 PRINT "AI win average undisturbed ocean ="; at
/ 11 PRINT "Total average undisturbed ocean =";
(at
+ pt
) / 25
And the results are here in last screen shot.
56% +/- of ocean is undisturbed in game, that means on Average only 44 shots are taken before a winner is determined!!!