Differences From Artifact [23ef619abd528e8f]:
- File
test.d
- 2012-07-14 01:07:03 - part of checkin [c357edc016] on branch trunk - Implemented flooding. (user: kinaba) [annotate]
To Artifact [5bf75f7f55fc5b47]:
- File
test.d
- 2012-07-14 01:58:20 - part of checkin [6819168095b] on branch trunk - Correct parsing of Flooding. (user: kinaba) [annotate]
37 // vertical sentinel 37 // vertical sentinel
38 char[] sen = new char[width+2]; 38 char[] sen = new char[width+2];
39 sen[] = '#'; 39 sen[] = '#';
40 data = sen.dup ~ data ~ sen; 40 data = sen.dup ~ data ~ sen;
41 41
42 // flooding 42 // flooding
43 water = H-1; 43 water = H-1;
44 string wfws = input.readln().chomp() ~ " "; | 44 while( (line=input.readln()).length ) {
45 wfws ~= input.readln().chomp() ~ " "; | 45 string[] ss = line.split();
46 wfws ~= input.readln().chomp(); <
47 string[] wfw = wfws.split(); <
48 if(wfw.length==6) { | 46 if(ss.length==2 && ss[0]=="Water")
49 water = H-1 - wfw[1].to!int(); | 47 water = H-1 - ss[1].to!int();
> 48 else if(ss.length==2 && ss[0]=="Flooding")
50 flooding = wfw[3].to!int(); | 49 flooding = ss[1].to!int();
> 50 else if(ss.length==2 && ss[0]=="Waterproof")
51 water_proof = wfw[5].to!int(); | 51 water_proof = ss[1].to!int();
52 } 52 }
53 } 53 }
54 54
55 @property const 55 @property const
56 { 56 {
57 int W() { return data[0].length; } 57 int W() { return data[0].length; }
58 int H() { return data.length; } 58 int H() { return data.length; }