Skip to content

Commit 2dda7fb

Browse files
committed
Init Halite II
1 parent d7c3a92 commit 2dda7fb

5 files changed

Lines changed: 61 additions & 0 deletions

File tree

codeclash/games/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from codeclash.games.dummy.dummy_game import DummyGame
55
from codeclash.games.game import CodeGame
66
from codeclash.games.halite.halite import HaliteGame
7+
from codeclash.games.halite2.halite2 import Halite2Game
78
from codeclash.games.huskybench.huskybench import HuskyBenchGame
89
from codeclash.games.robocode.robocode import RoboCodeGame
910
from codeclash.games.robotrumble.robotrumble import RobotRumbleGame
@@ -14,6 +15,7 @@
1415
CoreWarGame,
1516
DummyGame,
1617
HaliteGame,
18+
Halite2Game,
1719
HuskyBenchGame,
1820
RoboCodeGame,
1921
RobotRumbleGame,

codeclash/games/halite2/__init__.py

Whitespace-only changes.

codeclash/games/halite2/halite2.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from codeclash.games.halite.halite import HaliteGame
2+
3+
4+
class Halite2Game(HaliteGame):
5+
name: str = "Halite-II"
6+
description: str = ""
7+
default_args: dict = {}
8+
submission: str = "submission"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
tournament:
2+
rounds: 3
3+
game:
4+
name: Halite-II
5+
sims_per_round: 250
6+
players:
7+
- agent: dummy
8+
name: p1
9+
- agent: dummy
10+
name: p2
11+
prompts:
12+
game_description: |
13+
You are a software developer ({{player_id}}) competing in an arena called Halite.
14+
In this game, you will write code to control ships that gather resources, build structures, and compete for dominance on a grid-based map.
15+
Victory is achieved by outmaneuvering opponents, optimizing resource collection, and strategically expanding your territory.
16+
17+
The game is played in {{rounds}} rounds. For every round, you (and your competitor) edit program code that controls your bot. This is round {{round}}.
18+
After you and your competitor finish editing your codebases, the game is run automatically.
19+
20+
Your task: improve the bot, located in {{working_dir}}.
21+
{{working_dir}} is your codebase, which contains both your bot and supporting assets.

docker/Halite-II.Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM ubuntu:22.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Install Python 3.10 (and alias python→python3.10), pip, and prerequisites
6+
RUN apt-get update \
7+
&& apt-get install -y --no-install-recommends \
8+
curl ca-certificates python3.10 python3.10-venv \
9+
python3-pip python-is-python3 wget git build-essential jq curl locales cmake \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
# Install Rust via rustup
13+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \
14+
&& . "$HOME/.cargo/env" \
15+
&& echo 'source $HOME/.cargo/env' >> /etc/bash.bashrc
16+
ENV PATH="/root/.cargo/bin:${PATH}"
17+
18+
# Install ocaml
19+
RUN apt-get update && apt-get install -y ocaml ocamlbuild
20+
21+
# Clone Halite repository
22+
ARG GITHUB_TOKEN
23+
RUN git clone https://${GITHUB_TOKEN}@github.com/emagedoc/Halite-II.git /workspace \
24+
&& cd /workspace \
25+
&& git remote set-url origin https://github.com/emagedoc/Halite-II.git \
26+
&& unset GITHUB_TOKEN
27+
28+
WORKDIR /workspace
29+
30+
RUN cd environment && cmake . && make

0 commit comments

Comments
 (0)