Thursday, June 16, 2005

Using Randomization in Battleship Game

There are a set of challenges at http://www.xl-logic.com/pages/challenge.html and I thought I'd give the Battleship Challenge a go. It involves the use of random numbers to fill a Battleship board without the ships falling off the board or overlapping each other. I used colours to represent the ships. There was an extra challenge to use shapes for the ships. I tried this out, but could not get the vertical ships to line up correctly. The cell.top and .left and shape.top and .left properties seem to be out of sync when you rotate an auto shape by 90 degress. Maybe someone has a solution? You can download the workbook here.


Labels: