Overview
SHA1 Hash: | 05e91f8e53e53f21501ade36dd33a8b9e5157e4e |
---|---|
Date: | 2012-07-14 11:13:47 |
User: | kinaba |
Comment: | add infra for clever command. |
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 test.d from [5ea3ddf4a0f6a860] to [4262c5e337ee629c].
168 if(underwater > water_proof) 168 if(underwater > water_proof) 169 dead = true; 169 dead = true; 170 } 170 } 171 if(!wa) 171 if(!wa) 172 underwater = 0; 172 underwater = 0; 173 } 173 } 174 } 174 } > 175 > 176 int clever() > 177 { > 178 if(dead) > 179 return 0; > 180 int sy,sx; > 181 int[] ly,lx; > 182 int oy,ox; > 183 for(int y=0; y<H; ++y) > 184 for(int x=0; x<W; ++x) > 185 if(data[y][x]=='R') > 186 sy=y, sx=x; > 187 else if(data[y][x]=='\\') > 188 ly~=y, lx~=x; > 189 else if(data[y][x]=='O') > 190 oy=y, ox=x; > 191 if(ly.length==0) > 192 return goal(sy,sx,oy,ox); > 193 return wait(); > 194 } > 195 int goal(int sy, int sx, int oy, int ox) > 196 { > 197 } 175 } 198 } 176 199 177 class MyForm : Form 200 class MyForm : Form 178 { 201 { 179 Map m; 202 Map m; 180 int score; 203 int score; 181 204 ................................................................................................................................................................................ 254 stdout.flush(); 277 stdout.flush(); 255 break; 278 break; 256 case Keys.A: 279 case Keys.A: 257 score += m.abort(); 280 score += m.abort(); 258 write("A"); 281 write("A"); 259 stdout.flush(); 282 stdout.flush(); 260 break; 283 break; > 284 case Keys.G: > 285 score += m.clever(); > 286 write("_"); > 287 stdout.flush(); > 288 break; 261 default: 289 default: 262 break; 290 break; 263 } 291 } 264 if(m.cleared) { 292 if(m.cleared) { 265 writeln(); 293 writeln(); 266 writeln("Score: ", score); 294 writeln("Score: ", score); 267 Application.exit(); 295 Application.exit();