fork download
  1. # Perl (133) for Simple Life Game @ CodeIQ
  2. # modified for Perl 5.20 on ideone (1. added "no warnings;" 2. "gefor" -> "ge for")
  3. no warnings;
  4.  
  5. $n=<>;<>;$/=<>;@a=/./g,s##chr(46^4&6176>>grep!${$a[($x/$/%@a+$_%3-1)*$/%@a+($x+$_/3%3-1)%$/]},0..8,(4)x6).!++$x#ge for($_=<>)x$n;print
Success #stdin #stdout 1.3s 6880KB
stdin
30
40
35
...*.............*.*............*..
.....*.*...***......**......*......
**..........*..........*..*...**.**
...*...*...*.........*......**.*...
...*..*.......*.....**.*........**.
.**........**....*.......*......*..
...........*..*..*...*..*.......***
...*....*..............*......**...
.....*........*.*...*...*..**..*.*.
.....*.............*........*....**
....*......*.*..*..*.....*...*.....
........*.....*...*........*...*...
*...............*......*.*..****...
.*........*...**............*......
*..**...**.*......*.............**.
...*..*...*...**..*.........**.*...
......**........*.............**...
.***..*.*....*..***...**...........
.....*...**........................
..*...**........*.....*...*....**..
*....*....*....**..*........*......
........*....*****......*......*.**
........................*...*..**.*
*...*.....*..*......**....***....**
.....**......*......**.*........*.*
.*....*.*............*.*...........
.*......*.**...**................**
.......**.*...*...*..*....*..*..**.
....**..*...*...*..*......*..*.....
......*....*...*.*.*...............
..**.*..**........*.........*...*.*
....*..*.....*.**.............*.*..
...*..*.*..*..*.**..**..*......*...
..****.*....**.......*.........*.*.
.**.*......**.*....*.*..**.**...*..
........**..............*....*..*.*
..*...*.*....*...*..*.......*......
...**...**....*.*.*.***.*.*........
*..*....***.*...*..........*....*..
....*......*..*.......*...*..*.*...
stdout
**.....**......*..*.........*.....*
***.........................*.....*
.**...............................*
...............***..........*..*...
...........*...*............***....
..........**.......................
..........**..***..................
............*..**..................
............*..**..................
.............*.*...................
.............*.*...................
.............*.*...................
.**..........*.*...................
..............*....................
...................................
.................................**
.................................**
...................................
...................................
.......***.........................
.......*....................**.....
.......***..**.......**....*..*....
....................*.**..*........
..............*......*..*.*........
............*..*.....*..*.*........
...........**.**.......**....*.****
............*.*........*..***.***.*
...*.........*..........*.*..**....
...*.***...............**.....*....
........*...............*.****.....
.....*...................****......
.....*....................*........
......*...*........................
........*.*........................
.........*..................**.....
...........................*..*....
................*..........**.**...
....*..**......*.*..........*.**..*
.........*.....*...........**..*.**
....*....*.......**.........*...*..