Battleship_010 : (TM) Classic Game - Methodical Bot (100 move max) - MATLAB Cody - MATLAB Central

Problem 740. Battleship_010 : (TM) Classic Game - Methodical Bot (100 move max)

Difficulty:Rate

The Classic Battleship™ game implemented between a computer bot and a player's bot.

Battleship

You and your opponent have 9 ships of various sizes.

These Ships/Sizes/Qty are Carrier-5, Battleship-4, Submarine-3(qty 2), Cruiser-3(qty 2), Destroyer-2(qty-3).

The board is 10x10. (index 1-100) Unknown=0, Miss=1, Hit=2

The Play:

Player places his ships on the board. Ships may not overlap but may touch.

Ships array is [9,2] where 1 is the Carrier and 9 is a Destroyer.

[start_idx, orientation; start_idx, orientation...]. An orientation of 0 is Down and a 1 is Right.

Ships[1 1;...] places the Carrier in cells [1 11 22 33 44]

Player takes a shot on the board - idx 1:100.

The computer bot will take a shot if he has any ships remaining.

The player will see an updated board for his next shot if he has any ships remaining.

Pass: Win

Battleship_bot_010 randomly picks from Zero sectors.

Solution Stats

33.33% Correct | 66.67% Incorrect
Last Solution submitted on Jan 18, 2021

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8

Problem Recent Solvers4

Suggested Problems

More from this Author308

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!