Draft
6 By 6 Bimaru Solver
4 of 8S_OK
Description:
Bimaru
sometimes called Battleship puzzle, Battleship Solitaire or Yubotu is a logic puzzle based on the Battleship guessing game. Solitaire Battleship was invented in Argentina by Jaime Poniachik and was first featured in 1982 in the Argentine magazine Humor & Juegos.Rules
- Place a fleet of ships into the diagram. There are several different types of ships:
three submarines ♦ two destroyers ◄► one cruiser ◄■► - Each ship segment occupies exactly one cell of the diagram.
- Ships may be oriented horizontally or vertically and don't touch each other, neither orthogonally nor diagonally.
- The numbers on left/below edge of the diagram indicates how many ship segments must be placed in the corresponding row or column. Pass the clues in an array of 12 items. This array contains the clues around the clock
Can you write a program that can solve this puzzle?
Example
![]() |
In this example there are one boat square and one water square are specified. The following characters are valid:
|
Input
- The grid is one string. Every row ends with newline separater.
" \n \n \n ▲ \n X \n \n"
- The clues is an array of 12 numbers. This array contains around the clock (from top to bottom and right to left).
In this graphic, the numbers correspond to the index of the array.
Output
Return the resolved puzzle as array of six strings. The class Comparer
check only count, types and positions of the ships.
Good Luck!
If you finished this kata you can use your solution as a base for the more challenging kata:
coming soon... 8 By 8 Bimaru Solver
Games
Algorithms
Game Solvers
Puzzles
Similar Kata:
Stats:
Created | Jan 30, 2020 |
Warriors Trained | 264 |
Total Skips | 116 |
Total Code Submissions | 253 |
Total Times Completed | 8 |
C++ Completions | 4 |
C# Completions | 5 |
Total Stars | 9 |
% of votes with a positive feedback rating | 75% of 6 |
Total "Very Satisfied" Votes | 3 |
Total "Somewhat Satisfied" Votes | 3 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 4 |
Average Assessed Rank | 3 kyu |
Highest Assessed Rank | 2 kyu |
Lowest Assessed Rank | 4 kyu |