Index: src/game.d ================================================================== --- src/game.d +++ src/game.d @@ -317,21 +317,20 @@ if(collected_razor > 0) { collected_razor--; for(int dy=-1; dy<=+1; ++dy) for(int dx=-1; dx<=+1; ++dx) - if(this[robot.y+dy,robot.x+dx] == 'W') { - emptified(new Pos(robot.y+dy,robot.x+dx)); - this[robot.y+dy,robot.x+dx] = ' '; - } + if(this[robot.y+dy,robot.x+dx] == 'W') + emptify(new Pos(robot.y+dy,robot.x+dx)); } return update(hige_day); } // Register a position that may become empty in the last turn. - void emptified(Pos p) + void emptify(Pos p) { + this[p] = ' '; for(int dy=0; dy<=+1; ++dy) for(int dx=-1; dx<=+1; ++dx) may_update ~= new Pos(p.y+dy, p.x+dx); } @@ -344,35 +343,29 @@ if( '!' == this[next] ) collected_razor++; if( 'O' == this[next] ) cleared = true; if( is_spacy(this[next]) ) { - emptified(robot); - this[y,x] = ' '; - this[next] = 'R'; + emptify(robot); robot = next; + this[next] = 'R'; } else if(dy==0 && is_rocky(this[next]) && ' '==this[y+dy*2,x+dx*2]) { char rock = this[next]; - emptified(robot); - this[y,x] = ' '; + emptify(robot); + robot = next; this[next] = 'R'; this[y+dy*2,x+dx*2] = rock; - robot = next; may_update ~= new Pos(y+dy*2,x+dx*2); } else if(is_trampoline_source(this[next])) { - emptified(robot); - this[y,x] = ' '; + emptify(robot); Pos tp = tr.target_pos(this[next]); foreach(p; tr.source_pos(this[tp])) - { - emptified(p); - this[p] = ' '; - } + emptify(p); this[tp] = 'R'; robot = tp; } return update(hige_day); } @@ -388,11 +381,11 @@ foreach(wr; write_buffer) { this[wr[0],wr[1]] = wr[2]; if(is_rocky(wr[2])) may_update ~= new Pos(wr[0],wr[1]); if(wr[2]==' ') - emptified(new Pos(wr[0], wr[1])); + emptify(new Pos(wr[0], wr[1])); } } if(collected_lambda == total_lambda) if(this[lift]=='L')