Differences From Artifact [df1ca9c8d7e8adb9]:
- File
src/solver.d
- 2012-07-15 02:24:14 - part of checkin [9f1a8c70cd] on branch trunk - Razor using solver. (user: kinaba) [annotate]
To Artifact [98744373e0968733]:
- File
src/solver.d
- 2012-07-15 02:37:41 - part of checkin [c2c105fda0] on branch trunk - Support 'G' at any timing. (user: kinaba) [annotate]
1 1 import util;
2 2 import game;
3 3
4 4 class Solver_0
5 5 {
6 6 this(const(Game) g) {}
7 7 char single_step() { return 'W'; }
8 + void force(char c) {}
8 9 }
9 10
10 11 class Solver_1
11 12 {
12 13 int wait_count = 0;
13 14 int choke_count = 0;
14 15
................................................................................
22 23 char single_step()
23 24 {
24 25 Tuple!(string,int) de = death_move(g);
25 26 char c = act(g, de[0], de[1]);
26 27 g.command(c);
27 28 return c;
28 29 }
30 +
31 + void force(char c)
32 + {
33 + g.command(c);
34 + }
29 35
30 36 Tuple!(string,int) death_move(const(Game) g)
31 37 {
32 38 string death;
33 39 int choice = 0;
34 40 foreach(char c; "UDLRW") {
35 41 Game gg = g.clone();