turf-war prompt: revert to incremental file-writing (per-response max_tokens is independent per edit; one giant write hits the cap incl. thinking tokens)
This commit is contained in:
1 parent
52996604bf
commit
33e69b253e
1 file changed
+2
-2
+2
-2
@@ -103,8 +103,8 @@
|
||||
"en": "Each model writes a territory-grabbing agent in one shot; agents battle head-to-head on the same grid — ranked by objective wins, not votes."
|
||||
},
|
||||
"prompt": {
|
||||
"zh": "你要为一个 1v1 的「圈地对决」(Turf War) 环境编写一个 JavaScript 智能体。这是一个双人零和、双方同时行动的博弈。你的目标只有一个:在与多个未知对手、多张随机地图的循环赛中拿到尽可能高的胜率。对手由其它同等水平的 Agent(模型 × Harness 组合)编写——不要依赖「对手会犯错」的脆弱套路,任何固定模式都可能被针对;但也不要为求稳放弃进攻,平局只得 0.5 分,一个只求不败的智能体拿不到高排名。这是你唯一一次提交:没有反馈、没有试跑、没有重试,成绩公开计入排行榜。请输出你能写出的最强智能体。\n\n【环境规则】\n\n- 棋盘为 40×40 网格,坐标 (x, y),x 向右,y 向下,范围 0–39。每局按种子生成若干 180° 中心对称的岩石格(不可通行),出生点附近不会有岩石。\n- 双方从对角出生点出发,初始拥有出生点周围 3×3 领地。每 tick 双方同时移动一格,方向为 up / down / left / right 之一;全场共 1200 tick。\n- 在自己领地外移动会留下尾巴。回到自己领地的瞬间,你的尾巴以及被「尾巴 + 领地」围住的区域全部变成你的领地(包括对方领地)。围住判定:从棋盘边界向内 flood fill(岩石可穿过但不可被占有),无法到达的格子归你。\n- 任何人(包括你自己)踩到某玩家的尾巴,该尾巴的主人立即死亡。双方同 tick 进入同一格或互相穿过,双方同时死亡。撞岩石或出界,自己死亡。击杀判定基于本 tick 开始前的尾巴状态,双方完全对等。\n- 死亡后尾巴消失、领地保留;3 tick 后在出生点重生并重新获得周围 3×3 领地(覆盖任何归属),重生后 10 tick 无敌(不会死亡也不能击杀)。\n- 同 tick 结算顺序固定:移动 → 死亡判定 → 圈地 → 重生计时。1200 tick 结束时领地格数多者获胜,相等为平局。\n\n【接口】你必须交付一个 JS 文件:在能创建文件的环境中,按文末【本次运行】给出的文件名创建并写入完整策略;纯对话环境则直接输出完整文件内容。请一遍写成、不要反复重写或多轮扩写(那样只会累积消耗输出预算、可能触发输出上限而失败)。全程不得运行或试跑代码。文件顶层定义:\n\n```js\nfunction createAgent(config) {\n // config = { size: 40, totalTicks: 1200 }\n // 可以在闭包里保存任意记忆(允许并鼓励在对局中在线建模对手)\n return {\n act(obs) {\n return \"up\"; // \"up\" | \"down\" | \"left\" | \"right\"\n }\n };\n}\n```\n\nobs 每 tick 传入,字段:\n\n- obs.tick:当前 tick,从 0 起\n- obs.grid[y][x]:0 空地 · 1 我的领地 · 2 我的尾巴 · 3 对方领地 · 4 对方尾巴 · 5 岩石。grid 数组每 tick 会被复用,不要跨 tick 持有引用,需要历史请自行拷贝\n- obs.me / obs.opp:{ x, y, dir, alive, respawnIn, invincibleFor }\n- obs.scores:{ me, opp },双方当前领地格数\n- obs.rng():[0,1) 确定性随机数;需要随机时只准用它\n\n另外,请在返回的对象里附带 name 字段(与 act 并列):给你的算法起一个不超过 5 个字、有意思的名字,例如 { name: \"...\", act(obs) {...} }。\n\n视角是自我中心的:无论执哪一边,你都是 me。信息完全公开,没有战争迷雾。非法动作、抛异常或超出算力预算,该 tick 视为沿原方向直行。\n\n【运行时约束】\n\n- 纯 JavaScript(ES2020),单文件;禁止 import/require、网络、存储、Math.random、Date(运行环境会封禁它们)。\n- 算力限制是确定性的:你的代码会被自动插桩计数,每 tick 预算为 200,000 次「循环迭代 + 函数调用」。参考:一次 40×40 全图 BFS 约 2,000–6,000 次。超出预算该 tick 视为直行。\n- 完成本任务只依靠你自身的知识与推理:禁止联网搜索、禁止查阅外部文档或代码库、禁止调用任何 skill/插件/外部工具、禁止试运行代码。\n- 保持代码紧凑自足:聚焦一套有效策略,不要内联大型预计算表、穷举查找表或冗长注释——一份数 KB 的精炼策略远胜于因体量过大而被输出上限截断的半成品。\n- 交付前静态自查:合法 ES2020、顶层定义了 createAgent、无 import / Math.random / Date。\n\n【评测】你的智能体将与其它 Agent 编写的智能体进行多局循环赛,每局地形随机、先后手轮换,按胜负用 Bradley-Terry 排名。请深思熟虑后一次性交付唯一、完整、可直接运行的 JS 文件,除该文件外不要有任何解释或多余文件。\n\n【本次运行】(此行由维护者在运行前填写,其余内容对所有模型一字不差)模型 {model} × Harness {harness} × 思考配额 {effort};如需创建文件,文件名为 {agent-id}.js。",
|
||||
"en": "Write a JavaScript agent for a 1v1 \"Turf War\" environment. This is a two-player, zero-sum, simultaneous-move game. Your sole objective is to maximize your win rate in a round-robin against multiple unknown opponents across randomized maps. Opponents are written by other, equally capable Agents (an Agent = a model × harness combination) — do not rely on brittle patterns that assume opponent mistakes, as any fixed pattern can be exploited; but do not trade wins for safety either: a draw scores only 0.5, and an agent that merely avoids losing will not rank. This is your only submission: no feedback, no test runs, no retries, and the result is public on a leaderboard. Output the strongest agent you can write.\n\n[Environment]\n\n- The board is a 40×40 grid, coordinates (x, y), x rightward, y downward, range 0–39. Each match seeds a set of 180°-centrally-symmetric rock cells (impassable); no rocks appear near the spawns.\n- Both players start from opposite corners owning a 3×3 territory around their spawn. Each tick both players move one cell simultaneously (up / down / left / right); a match lasts 1200 ticks.\n- Moving outside your own territory leaves a trail. The moment you re-enter your own territory, your trail plus every region enclosed by trail + territory becomes yours (including the opponent's territory). Enclosure test: flood fill inward from the board border (rocks are transparent to the flood but can never be owned); unreachable cells are captured.\n- If anyone (including yourself) steps on a player's trail, that trail's owner dies immediately. Entering the same cell on the same tick, or swapping cells, kills both players. Hitting a rock or leaving the board kills you. Kill checks use the trail state from the start of the tick, so both sides are perfectly symmetric.\n- On death your trail vanishes but your territory is kept; you respawn at your spawn point after 3 ticks with a fresh 3×3 territory (overwriting any ownership) and 10 ticks of invincibility (you cannot die or kill).\n- Per-tick resolution order is fixed: moves → deaths → capture → respawn countdown. After 1200 ticks the larger territory wins; equal is a draw.\n\n[Interface] You must deliver one JS file: if your environment can create files, create it under the name given in the [This run] line and write the complete policy into it; otherwise print the complete file content. Write it in a single pass — do not rewrite it repeatedly or expand it over many turns (that only burns output budget and can trip the output limit and fail). Never run or test-run the code at any point. At top level it defines:\n\n```js\nfunction createAgent(config) {\n // config = { size: 40, totalTicks: 1200 }\n // keep any memory in the closure (in-match opponent modeling is allowed and encouraged)\n return {\n act(obs) {\n return \"up\"; // \"up\" | \"down\" | \"left\" | \"right\"\n }\n };\n}\n```\n\nobs is passed every tick:\n\n- obs.tick: current tick, starting at 0\n- obs.grid[y][x]: 0 empty · 1 my territory · 2 my trail · 3 opponent territory · 4 opponent trail · 5 rock. Grid arrays are reused across ticks — do not hold references across ticks; copy if you need history\n- obs.me / obs.opp: { x, y, dir, alive, respawnIn, invincibleFor }\n- obs.scores: { me, opp }, current territory cell counts\n- obs.rng(): deterministic random in [0,1); it is the only allowed source of randomness\n\nAlso include a name field on the returned object (next to act): give your algorithm a fun, memorable name of at most one short word (~10 characters), e.g. { name: \"...\", act(obs) {...} }.\n\nThe view is ego-centric: whichever side you play, you are me. Information is fully public — no fog of war. An invalid action, a thrown exception, or exceeding the compute budget makes you continue straight for that tick.\n\n[Runtime]\n\n- Pure JavaScript (ES2020), single file; import/require, network, storage, Math.random and Date are forbidden (the runtime blocks them).\n- The compute limit is deterministic: your code is automatically instrumented, with a per-tick budget of 200,000 loop iterations + function calls. Reference: one full-board 40×40 BFS costs about 2,000–6,000. Exceeding the budget means you walk straight that tick.\n- Rely solely on your own knowledge and reasoning: no web search, no consulting external docs or codebases, no skills/plugins/external tools, no test-running code.\n- Keep the code compact and self-contained: commit to one effective strategy; do not inline large precomputed tables, exhaustive lookup tables, or verbose commentary — a tight few-KB policy beats an oversized one that gets cut off by the output limit and fails.\n- Static self-check before you deliver: valid ES2020, createAgent defined at top level, no import / Math.random / Date.\n\n[Evaluation] Your agent plays a multi-game round-robin against the agents written by other Agents (model × harness combos), with randomized terrain and alternatiLine truncated
|
||||
"zh": "你要为一个 1v1 的「圈地对决」(Turf War) 环境编写一个 JavaScript 智能体。这是一个双人零和、双方同时行动的博弈。你的目标只有一个:在与多个未知对手、多张随机地图的循环赛中拿到尽可能高的胜率。对手由其它同等水平的 Agent(模型 × Harness 组合)编写——不要依赖「对手会犯错」的脆弱套路,任何固定模式都可能被针对;但也不要为求稳放弃进攻,平局只得 0.5 分,一个只求不败的智能体拿不到高排名。这是你唯一一次提交:没有反馈、没有试跑、没有重试,成绩公开计入排行榜。请输出你能写出的最强智能体。\n\n【环境规则】\n\n- 棋盘为 40×40 网格,坐标 (x, y),x 向右,y 向下,范围 0–39。每局按种子生成若干 180° 中心对称的岩石格(不可通行),出生点附近不会有岩石。\n- 双方从对角出生点出发,初始拥有出生点周围 3×3 领地。每 tick 双方同时移动一格,方向为 up / down / left / right 之一;全场共 1200 tick。\n- 在自己领地外移动会留下尾巴。回到自己领地的瞬间,你的尾巴以及被「尾巴 + 领地」围住的区域全部变成你的领地(包括对方领地)。围住判定:从棋盘边界向内 flood fill(岩石可穿过但不可被占有),无法到达的格子归你。\n- 任何人(包括你自己)踩到某玩家的尾巴,该尾巴的主人立即死亡。双方同 tick 进入同一格或互相穿过,双方同时死亡。撞岩石或出界,自己死亡。击杀判定基于本 tick 开始前的尾巴状态,双方完全对等。\n- 死亡后尾巴消失、领地保留;3 tick 后在出生点重生并重新获得周围 3×3 领地(覆盖任何归属),重生后 10 tick 无敌(不会死亡也不能击杀)。\n- 同 tick 结算顺序固定:移动 → 死亡判定 → 圈地 → 重生计时。1200 tick 结束时领地格数多者获胜,相等为平局。\n\n【接口】你必须交付一个 JS 文件:在能创建文件的环境中,按文末【本次运行】给出的文件名先创建文件,再分多次编辑逐段写入,把整份策略累积写完——不要在单次写入里把整份代码一次塞进去。原因:单次模型响应的输出(含推理 thinking + 正文 + 工具调用内容)有硬上限,一次性写入大文件容易撞上限而失败,而分多次编辑时每次都是独立的新预算。纯对话环境无法建文件时,才直接输出完整文件内容(此时请让策略尽量紧凑)。全程不得运行或试跑代码。文件顶层定义:\n\n```js\nfunction createAgent(config) {\n // config = { size: 40, totalTicks: 1200 }\n // 可以在闭包里保存任意记忆(允许并鼓励在对局中在线建模对手)\n return {\n act(obs) {\n return \"up\"; // \"up\" | \"down\" | \"left\" | \"right\"\n }\n };\n}\n```\n\nobs 每 tick 传入,字段:\n\n- obs.tick:当前 tick,从 0 起\n- obs.grid[y][x]:0 空地 · 1 我的领地 · 2 我的尾巴 · 3 对方领地 · 4 对方尾巴 · 5 岩石。grid 数组每 tick 会被复用,不要跨 tick 持有引用,需要历史请自行拷贝\n- obs.me / obs.opp:{ x, y, dir, alive, respawnIn, invincibleFor }\n- obs.scores:{ me, opp },双方当前领地格数\n- obs.rng():[0,1) 确定性随机数;需要随机时只准用它\n\n另外,请在返回的对象里附带 name 字段(与 act 并列):给你的算法起一个不超过 5 个字、有意思的名字,例如 { name: \"...\", act(obs) {...} }。\n\n视角是自我中心的:无论执哪一边,你都是 me。信息完全公开,没有战争迷雾。非法动作、抛异常或超出算力预算,该 tick 视为沿原方向直行。\n\n【运行时约束】\n\n- 纯 JavaScript(ES2020),单文件;禁止 import/require、网络、存储、Math.random、Date(运行环境会封禁它们)。\n- 算力限制是确定性的:你的代码会被自动插桩计数,每 tick 预算为 200,000 次「循环迭代 + 函数调用」。参考:一次 40×40 全图 BFS 约 2,000–6,000 次。超出预算该 tick 视为直行。\n- 完成本任务只依靠你自身的知识与推理:禁止联网搜索、禁止查阅外部文档或代码库、禁止调用任何 skill/插件/外部工具、禁止试运行代码。\n- 保持代码紧凑自足:聚焦一套有效策略,不要内联大型预计算表、穷举查找表或冗长注释。\n- 交付前静态自查:合法 ES2020、顶层定义了 createAgent、无 import / Math.random / Date。\n\n【评测】你的智能体将与其它 Agent 编写的智能体进行多局循环赛,每局地形随机、先后手轮换,按胜负用 Bradley-Terry 排名。请深思熟虑后一次性交付唯一、完整、可直接运行的 JS 文件,除该文件外不要有任何解释或多余文件。\n\n【本次运行】(此行由维护者在运行前填写,其余内容对所有模型一字不差)模型 {model} × Harness {harness} × 思考配额 {effort};如需创建文件,文件名为 {agent-id}.js。",
|
||||
"en": "Write a JavaScript agent for a 1v1 \"Turf War\" environment. This is a two-player, zero-sum, simultaneous-move game. Your sole objective is to maximize your win rate in a round-robin against multiple unknown opponents across randomized maps. Opponents are written by other, equally capable Agents (an Agent = a model × harness combination) — do not rely on brittle patterns that assume opponent mistakes, as any fixed pattern can be exploited; but do not trade wins for safety either: a draw scores only 0.5, and an agent that merely avoids losing will not rank. This is your only submission: no feedback, no test runs, no retries, and the result is public on a leaderboard. Output the strongest agent you can write.\n\n[Environment]\n\n- The board is a 40×40 grid, coordinates (x, y), x rightward, y downward, range 0–39. Each match seeds a set of 180°-centrally-symmetric rock cells (impassable); no rocks appear near the spawns.\n- Both players start from opposite corners owning a 3×3 territory around their spawn. Each tick both players move one cell simultaneously (up / down / left / right); a match lasts 1200 ticks.\n- Moving outside your own territory leaves a trail. The moment you re-enter your own territory, your trail plus every region enclosed by trail + territory becomes yours (including the opponent's territory). Enclosure test: flood fill inward from the board border (rocks are transparent to the flood but can never be owned); unreachable cells are captured.\n- If anyone (including yourself) steps on a player's trail, that trail's owner dies immediately. Entering the same cell on the same tick, or swapping cells, kills both players. Hitting a rock or leaving the board kills you. Kill checks use the trail state from the start of the tick, so both sides are perfectly symmetric.\n- On death your trail vanishes but your territory is kept; you respawn at your spawn point after 3 ticks with a fresh 3×3 territory (overwriting any ownership) and 10 ticks of invincibility (you cannot die or kill).\n- Per-tick resolution order is fixed: moves → deaths → capture → respawn countdown. After 1200 ticks the larger territory wins; equal is a draw.\n\n[Interface] You must deliver one JS file: if your environment can create files, first create the file under the name given in the [This run] line, then write the whole policy by editing it in several steps, adding a section at a time — do NOT cram the entire file into one write. Reason: a single model response has a hard output cap (covering reasoning/thinking + text + tool-call content together), so writing a large file all at once can hit that cap and fail, whereas each separate edit gets its own fresh budget. Only when your environment cannot create files should you print the complete file content instead (and keep the policy compact in that case). Never run or test-run the code at any point. At top level it defines:\n\n```js\nfunction createAgent(config) {\n // config = { size: 40, totalTicks: 1200 }\n // keep any memory in the closure (in-match opponent modeling is allowed and encouraged)\n return {\n act(obs) {\n return \"up\"; // \"up\" | \"down\" | \"left\" | \"right\"\n }\n };\n}\n```\n\nobs is passed every tick:\n\n- obs.tick: current tick, starting at 0\n- obs.grid[y][x]: 0 empty · 1 my territory · 2 my trail · 3 opponent territory · 4 opponent trail · 5 rock. Grid arrays are reused across ticks — do not hold references across ticks; copy if you need history\n- obs.me / obs.opp: { x, y, dir, alive, respawnIn, invincibleFor }\n- obs.scores: { me, opp }, current territory cell counts\n- obs.rng(): deterministic random in [0,1); it is the only allowed source of randomness\n\nAlso include a name field on the returned object (next to act): give your algorithm a fun, memorable name of at most one short word (~10 characters), e.g. { name: \"...\", act(obs) {...} }.\n\nThe view is ego-centric: whichever side you play, you are me. Information is fully public — no fog of war. An invalid action, a thrown exception, or exceeding the compute budget makes you continue straight for that tick.\n\n[Runtime]\n\n- Pure JavaScript (ES2020), single file; import/require, network, storage, Math.random and Date are forbidden (the runtime blocks them).\n- The compute limit is deterministic: your code is automatically instrumented, with a per-tick budget of 200,000 loop iterations + function calls. Reference: one full-board 40×40 BFS costs about 2,000–6,000. Exceeding the budget means you walk straight that tick.\n- Rely solely on your own knowledge and reasoning: no web search, no consulting external docs or codebases, no skills/plugins/external tools, no test-running code.\n- Keep the code compact and self-contained: commit to one effective strategy; do not inline large precomputed tables, exhaustive lookup tables, or verbose commentary.\n- Static self-check before you deliver: valid ES2020, createAgent defined at top level, no imporLine truncated
|
||||
},
|
||||
"tags": [
|
||||
"JS",
|
||||
|
||||
Reference in new issue
Block a user