Differences From Artifact [487b856e16418ffe]:
- File
test.d
- 2012-07-14 03:25:31 - part of checkin [c7b79323fc] on branch trunk - Water rising comes after robot water-proof judgement. (user: kinaba) [annotate]
To Artifact [d9955daaabe58d54]:
- File
src/test.d
- 2012-07-14 09:16:47 - part of checkin [6293256fec] on branch trunk - Preparing for submission... (user: kinaba) [annotate]
- File
test.d
- 2012-07-14 03:42:25 - part of checkin [f37675299a] on branch trunk - Handle SIGINT. (user: kinaba) [annotate]
1 import std.algorithm; 1 import std.algorithm;
2 import std.array; 2 import std.array;
3 import std.conv; 3 import std.conv;
4 import std.stdio; 4 import std.stdio;
5 import std.string; 5 import std.string;
6 import std.typecons; 6 import std.typecons;
> 7 import core.stdc.signal;
> 8 import core.stdc.stdlib;
7 import dfl.all; 9 import dfl.all;
8 10
9 class Map 11 class Map
10 { 12 {
11 private char[][] data; 13 private char[][] data;
12 bool dead = false; 14 bool dead = false;
13 bool cleared = false; 15 bool cleared = false;
................................................................................................................................................................................
371 writeln("Score: ", score); 373 writeln("Score: ", score);
372 Application.exit(); 374 Application.exit();
373 } 375 }
374 this.text = .text("Score: ", score, " air[",m.water_proof-m.und 376 this.text = .text("Score: ", score, " air[",m.water_proof-m.und
375 invalidate(); 377 invalidate();
376 } 378 }
377 } 379 }
> 380
> 381 extern(C) {
> 382 void sigint(int) {
> 383 write("A");
> 384 stdout.flush();
> 385 exit(0);
> 386 }
> 387 }
378 388
379 void main(string[] args) 389 void main(string[] args)
380 { 390 {
> 391 signal(SIGINT, &sigint);
> 392
381 Form myForm = new MyForm(new Map(File(args[1]))); 393 Form myForm = new MyForm(new Map(File(args[1])));
382 Application.run(myForm); 394 Application.run(myForm);
383 } 395 }