Overview
SHA1 Hash: | 8acc8e6c78ff200ae4c6da882e29acc222ffc840 |
---|---|
Date: | 2012-07-15 16:02:32 |
User: | kinaba |
Comment: | Prioritize distant lambda. |
Timelines: | family | ancestors | descendants | both | trunk |
Diffs: | redesign |
Downloads: | Tarball | ZIP archive |
Other Links: | files | file ages | manifest |
Tags And Properties
- branch=trunk inherited from [16f0b5784f]
- sym-trunk inherited from [16f0b5784f]
Changes
Modified score_memo.txt from [a7904b90ae36b3e4] to [d46da9814cb8619d].
1 1 contest1 212! 2 -contest2 273? 2 +contest2 280? 3 3 contest3 275! 4 4 contest4 561? 5 5 contest5 1281? 6 6 contest6 737 7 7 contest7 867? 8 8 contest8 1245 9 9 contest9 3042? 10 10 contest10 2076 11 11 flood1 569 12 -flood2 273? 12 +flood2 280? 13 13 flood3 802 14 14 flood4 970 15 15 flood5 561? 16 16 trampoline1 291 17 17 trampoline2 1728? 18 18 trampoline3 698 19 19 beard1 856? 20 20 beard2 2792 21 21 beard3 811 22 22 beard4 677
Modified src/solver.d from [dde2fe1d85562c17] to [57f6f73657cc3655].
52 52 } 53 53 54 54 Tuple!(Pos, int)[] log; 55 55 bool[][] forbidden_cell; 56 56 57 57 char act(const(Game) g, string death, int breath) 58 58 { 59 - const Pos ro = g.map.robot; 60 - const Pos[] la = g.map.lambdas(); 61 - const Pos[] ra = g.map.razors(); 62 - const Pos li = g.map.lift; 63 - const Pos[] hi = g.map.objects('W'); 59 + const Pos ro = g.map.robot; 60 + const Pos li = g.map.lift; 61 + Pos[] la = g.map.lambdas(); 62 + sort!((Pos a,Pos b){ 63 + int ad=abs(a.y-li.y)+abs(a.x-li.x); 64 + int bd=abs(b.y-li.y)+abs(b.x-li.x); 65 + return ad>bd;; 66 + })(la); 67 + Pos[] ra = g.map.razors(); 68 + const(Pos)[] hi = g.map.objects('W'); 64 69 65 70 Tuple!(char,int)[] cand; 66 71 char c = 'W'; 67 72 if( la.empty ) { 68 73 cand = search(g, ro, [li], death); 69 74 } else { 70 75 cand ~= search(g, ro, la~ra, death);
Modified src/util.d from [3ea557146e66a2fa] to [41ba420d0c49ce8d].
1 1 public import std.algorithm; 2 2 public import std.array; 3 3 public import std.conv; 4 4 public import std.range; 5 5 public import std.stdio; 6 6 public import std.string; 7 7 public import std.typecons; 8 +public import std.math; 8 9 import std.c.stdlib; 9 10 10 11 // To avoide the following ICE: 11 12 // src\phobos\std\algorithm.d(4552): 12 13 // Error: function std.algorithm.count!("a == b",string,char).count 13 14 // compiler error, parameter 'value', bugzilla 2962? 14 15 // Assertion failure: '0' on line 717 in file 'glue.c'