kicking the tires on jev (TypeSafe's System One model) with 2048
Kicking the tires on Jev (TypeSafe’s System One model) with 2048
使用 2048 游戏测试 Jev(TypeSafe 的 System One 模型)
I finally got a chance to kick the tires on Jev (jev-1.13.0). I thought it’d do really well playing 2048. The strategy I used was: hand it the current board state and give it the option of up, down, left, right. I tried that 4 ways (the Jev rows in the table). Each row links to the request I sent. 我终于有机会试用一下 Jev (jev-1.13.0) 了。我原以为它在玩 2048 游戏时会有出色的表现。我采用的策略是:将当前的棋盘状态交给它,并提供上、下、左、右四个选项。我尝试了四种不同的方式(见下表中的 Jev 行)。每一行都链接到我发送的请求。
With just the board, it does about as well as making random moves. It does best when code works out what each move would do to the board and Jev picks from those; then it’s about as good as a fixed rule (e.g., always left if that moves anything, else down, else right, else up). I didn’t have long to spend on it, so I’m likely missing something. 仅提供棋盘状态时,它的表现与随机移动差不多。当代码预先计算出每一步移动对棋盘的影响,再让 Jev 从中选择时,它的表现最好;此时它的水平大约相当于一条固定规则(例如:如果向左能移动则始终向左,否则向下,再否则向右,最后向上)。我没有太多时间深入研究,所以很可能遗漏了一些关键点。
Scores (Every game was played to the end)
得分(每局游戏均进行到底)
| Player | Games | Min | Median | Max | Best Tile | First choice did nothing |
|---|---|---|---|---|---|---|
| 玩家 | 局数 | 最小值 | 中位数 | 最大值 | 最大方块 | 首选无效 |
| Random moves | 48 | 512 | 1102 | 2672 | 256 | n/a |
| 随机移动 | 48 | 512 | 1102 | 2672 | 256 | 不适用 |
| Fixed rule: down if it moves anything, else left, else right, else up | 48 | 720 | 1964 | 7196 | 512 | n/a |
| 固定规则:能下则下,否则左,再否则右,最后上 | 48 | 720 | 1964 | 7196 | 512 | 不适用 |
| Fixed rule: left if it moves anything, else down, else right, else up | 48 | 296 | 2740 | 5944 | 512 | n/a |
| 固定规则:能左则左,否则下,再否则右,最后上 | 48 | 296 | 2740 | 5944 | 512 | 不适用 |
| Jev, given the board | 20 | 404 | 706 | 2340 | 128 | 24% |
| Jev,仅给定棋盘 | 20 | 404 | 706 | 2340 | 128 | 24% |
| Jev, given the board, the rules and a description of each move | 20 | 180 | 1656 | 3520 | 256 | 19% |
| Jev,给定棋盘、规则及每步移动描述 | 20 | 180 | 1656 | 3520 | 256 | 19% |
| Jev, given the board and a tip: “keep the big tile in the bottom-left corner” | 18 | 432 | 1454 | 4120 | 256 | 27% |
| Jev,给定棋盘及提示:“将大方块保持在左下角” | 18 | 432 | 1454 | 4120 | 256 | 27% |
| Jev, given the board each move would lead to, the points it scores, and the same tip | 18 | 596 | 2494 | 5532 | 512 | n/a |
| Jev,给定每步移动后的棋盘、得分及相同提示 | 18 | 596 | 2494 | 5532 | 512 | 不适用 |
First choice did nothing: How often Jev’s top pick was a move that doesn’t change the board (e.g., left, when every tile is already against the left wall and nothing can merge). When that happened I played its next pick. 首选无效: 指 Jev 的首选动作无法改变棋盘状态的频率(例如:当所有方块已靠在左墙且无法合并时,它仍选择向左)。当这种情况发生时,我采用了它的第二个选择。
n/a: Random and the fixed rules only pick moves that do something, and in the last Jev row those were the only ones on offer. 不适用: 随机移动和固定规则只会选择有效的移动;而在最后一行 Jev 的测试中,提供的选项本身就只有有效移动。
(Note: The original article continues with JSON request payloads. These are technical implementation details and have been omitted for brevity as per the request for a clean news format.) (注:原文后续包含 JSON 请求负载。这些属于技术实现细节,为保持简洁,已根据要求省略。)