When you fire a shot, you will need to know if it was a hit or a miss. So, your fleet will be 5 ships, each with a size just 1. This does not allow for many ships or big ones. Using the micro:bit display as a Battleship board: Since micro:bit has aĥx5 display, your battleship board needs to be smaller.
In the section above, you saw an example of the game, with a 10x10 board. Let’s start with going over the different pieces we need to program theīattleship.
The concept of unicast communication, two-way communication andĭesigning the Battleship for Microbit ¶ How the game works ¶ Handling errors: Retransmissions and Handling errors: Acknowledgements. The variant in Exercises, you will use information from On in Unicast Communication: One to One and Two way unicast. Game requires unicast and bidirectional communication, which you worked To program the Battleship into your micro:bits, you will use your networking knowledge. Record each hit and miss to decide which shot to fire next. Players keep a second board to mark the shots they have already tried. Opponent has sunk the ship on squares 8A-8B. Of these crosses did not hit any ships, and some of them did. In the example board, the crosses mark the shots of the opponent. On their boards, they start guessing the position of (shooting at) their opponent's ships. Once both players have placed their ships Arrangement ships is of course hidden from the opponent. Ships of size 2, 3 ships of size 3, 2 ships of size 4, and 1 ship of The figure shows the placement for one of the players: 4 In this example, each player uses their own 10x10 board, and each player's fleet includesġ0 ships of different sizes (the grey rectangles). Let's look at how this game works using the example board in the figure above.