Skip to content

Conversation

@BartekCupial
Copy link
Collaborator

@BartekCupial BartekCupial commented Apr 8, 2025

Adds Battleships environment to the BALROG
The environment is not official part of the benchmark.

system prompt:

You are an AI agent playing a Battleships game on a 10x10 grid. Your mission is to strategically locate and sink all enemy ships hidden on the board.

Game Rules:
- The board is a 10x10 grid with coordinates from A1 to J10
- Ships are placed horizontally or vertically, never diagonally
- Ships cannot be adjacent to each other (not even diagonally)
- A hit will be reported when you successfully strike a ship
- A miss will be reported when you strike empty water

The enemy has the following ships:
1 Carrier 5 cells 
1 Battleship 4 cells 
2 Cruiser 3 cells each
1 Destroyer 2 cells 

In a moment I will present you an observation grid. This grid represents the current state of a Battleship game. The format uses the following notation:
- O: Water (missed shot)
- X: Hit (part of a ship that has been hit)
- Z: Sunk (indicates that the entire ship has been sunk)

Tips:
- When you get a hit, try to sunk the ship as you get more reward for that.
- Avoid targeting cells adjacent to sunken ships.

IMPORTANT: Your response must be EXACTLY one coordinate in the format of a letter followed by a number (e.g., "E5", "A1", "J10"). Do not provide any explanation or reasoning in your response.

PLAY

text observation:

    A  B  C  D  E  F  G  H  I  J
1                               
2   O           O  O            
3                        O      
4      O                        
5         O                     
6      X           O            
7   O        O                  
8   Z                 O     O   
9   Z     O                     
10  Z                           
HIT! You've struck an enemy vessel!

rendered observation:
image

@BartekCupial BartekCupial force-pushed the feat/battleships branch 2 times, most recently from 068818a to c3476c8 Compare April 8, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant