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 1 import std.algorithm;
2 2 import std.array;
3 3 import std.conv;
4 4 import std.stdio;
5 5 import std.string;
6 6 import std.typecons;
7 +import core.stdc.signal;
8 +import core.stdc.stdlib;
7 9 import dfl.all;
8 10
9 11 class Map
10 12 {
11 13 private char[][] data;
12 14 bool dead = false;
13 15 bool cleared = false;
................................................................................
371 373 writeln("Score: ", score);
372 374 Application.exit();
373 375 }
374 376 this.text = .text("Score: ", score, " air[",m.water_proof-m.underwater,"]");
375 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 389 void main(string[] args)
380 390 {
391 + signal(SIGINT, &sigint);
392 +
381 393 Form myForm = new MyForm(new Map(File(args[1])));
382 394 Application.run(myForm);
383 395 }