| 17 | description: str = """CoreWar is a programming battle where you write "warriors" in an assembly-like language called Redcode to compete within a virtual machine (MARS), aiming to eliminate your rivals by making their code self-terminate. |
| 18 | Victory comes from crafting clever tactics—replicators, scanners, bombers—that exploit memory layout and instruction timing to control the core. |
| 19 | |
| 20 | Reading the logs: each round's score is computed over many simulated battles, but only a sample of them are saved as replay traces (`sim_*.jsonl`) in `/logs/` due to storage limits. The score reflects every battle played, not just the replayed subset, so treat the replays as representative examples rather than the full basis of the result.""" |
| 21 | submission: str = "warrior.red" |
| 22 | |
| 23 | def __init__(self, config, **kwargs): |
| 24 | super().__init__(config, **kwargs) |
| 25 | # Always run in brief mode (`-b`). Without it, pmars prints disassembled listing of |
| 26 | # every warrior, which leaks opponent |
| 27 | self.run_cmd_round: str = "./src/pmars -b" |
| 28 | for arg, val in self.game_config.get("args", self.default_args).items(): |
| 29 | if isinstance(val, bool): |
| 30 | if val: |