Minesweeper
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
For each squares without mine (shown by '.'), tell the number of mines (shown by '*') in adjacent squares. The test cases always have 16x16 squares and 40 mines.
This problem is set by leonid & shinh to enjoy a "speed golfing" event. We are planning to solve this problem within 2 hours in Ruby. We'll use (2hrs) suffixes (e.g., "shinh (2hrs)") as our name during the mini event. Please join us with the (2hrs) suffix if you have time. Of course, solutions with other languages will be welcomed, although I'm not sure if there are other competitors.
We'll finish this speed golfing at 9pm in PDT. After this time, this problem bec
omes a usual 2 week problem. Please check this link for the deadline of the speed golfing in your timezone: http://www.timeanddate.com/worldclock/fixedtime.html?&day=30&month=07&year=2012&hour=21&min=00&sec=0&p1=224
This problem is inspired by a problem in Perl Golf history book (http://terje2.frox25.no-ip.org/). The solutions in this book may not work for this problem due to size difference, but you may be able to use them as a big hint.
Options
exec is denied
now post-mortem time, all source codes will be revealed
Sample input:_
.....***..*.....
...*.*....**....
..*...........*.
..*......*...*..
....*.**.......*
................
.......*..*.....
.*....*........*
.....*..**......
.......*.*......
.....*...*......
.....*..........
.......*........
.....**.*.......
.....*.*..*..*..
.....*.*........
Sample output:
00113***12*31000
012*3*4212**1111
02*32110123222*1
02*312222*101*32
0112*2**2110112*
0001123321110011
1110012*11*10011
1*1012*33321001*
11101*33**200011
0000223*5*300000
00002*313*200000
00002*3121100000
0000234*21000000
00002**4*2111110
00003*6*32*11*10
00002*4*21111110
Sample input:_
.*.*.*........*.
**.***........**
*...............
.........*......
................
................
..............**
..............*.
............*.**
...............*
**........*.....
.*...*..........
**..............
................
**......***...**
.**.....*.*..**.
Sample output:
3*4*5*20000002*3
**4***20000002**
*322321011100122
110000001*100000
0000000011100000
0000000000000122
00000000000002**
00000000000114*5
000000000001*3**
221000000112123*
**20111001*10011
5*301*1001110000
**20111000000000
4420000123210122
**310002***213**
3**10002*5*21**3
Sample input:_
*..*.*...*.....*
..............*.
*.........*.....
....*....*...*..
...........***..
.*.........*.*..
............****
............*.*.
............***.
................
..........*.*...
.....*..........
*.....*.........
......**....*...
.........**.....
*.*..........*.*
Sample output:
*11*2*101*10012*
22112110122101*2
*101110012*11221
1101*1001*334*20
11111100113***30
1*100000002*7*52
111000000013****
000000000003*8*4
000000000002***2
0000000001133421
0000111001*2*100
11001*2101121100
*10013*310011100
110002**2222*100
121101222**22221
*2*1000012211*2*
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | nai | 45 | 0.0621 | 2012/08/11 12:15:05 | 0B / 23B / 20B |
2 | tails | 46 | 0.0370 | 2012/08/03 23:31:30 | 1B / 20B / 22B |
3 | teebee | 47 | 0.0386 | 2012/08/03 12:11:59 | 1B / 21B / 22B |
4 | shinh | 54 | 0.1902 | 2012/08/01 16:18:33 | 0B / 26B / 22B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | leonid | 113 | 0.0848 | 2012/08/14 07:43:50 | 0B / 55B / 50B |
2 | hallvabo | 116 | 0.1010 | 2012/08/10 08:53:50 | 0B / 58B / 47B |
3 | clock | 117 | 0.0718 | 2012/08/09 06:15:23 | 0B / 63B / 43B |
4 | twobit | 124 | 0.1792 | 2012/08/01 21:42:50 | 0B / 55B / 65B |
5 | leonid (2hrs) | 125 | 0.0938 | 2012/07/31 12:23:08 | 0B / 57B / 58B |
6 | Puzzlet Chung | 140 | 0.0602 | 2012/08/02 03:50:10 | 0B / 79B / 54B |
7 | Puzzlet Chung (2hrs) | 152 | 0.0933 | 2012/07/31 12:57:14 | 0B / 90B / 54B |
8 | comfuture (2hrs) | 177 | 0.0585 | 2012/07/31 12:21:50 | 0B / ?B / ?B |
9 | comfuture | 190 | 0.0725 | 2012/07/31 11:50:54 | 1B / ?B / ?B |
10 | sublee | 549 | 0.0703 | 2012/07/31 11:36:50 | 21B / 179B / 70B |
11 | sublee (2hrs) | 553 | 0.1124 | 2012/07/31 12:13:36 | 19B / ?B / ?B |
12 | leonid | 111 | 0.0694 | 2012/08/14 11:10:47 | 0B / 54B / 49B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | youz | 101 | 3.1382 | 2012/07/31 17:01:23 | 0B / 63B / 30B |
2 | youz (2hrs) | 129 | 4.1349 | 2012/07/31 12:57:38 | 0B / 62B / 48B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | 0mg | 134 | 0.1284 | 2012/08/09 17:38:21 | 0B / 66B / 66B |
2 | matyr (2hrs) | 135 | 0.0686 | 2012/07/31 12:02:45 | 0B / 64B / 67B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | clock | 131 | 0.0356 | 2012/08/09 18:33:52 | 0B / 75B / 49B |
2 | twobit | 132 | 0.0360 | 2012/08/09 18:35:49 | 0B / 75B / 51B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | I., S. | 52 | 0.0957 | 2012/08/01 22:58:08 | 0B / 14B / 36B |
2 | I., S. | 51 | 0.0736 | 2013/11/06 00:18:18 | 0B / 12B / 37B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | teebee | 55 | 0.0410 | 2012/08/06 15:57:41 | 0B / 16B / 37B |
2 | twobit | 60 | 0.0353 | 2012/08/08 06:05:39 | 0B / 16B / 42B |
3 | av | 96 | 0.0399 | 2012/08/13 11:00:17 | 2B / 21B / 69B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nu | 95 | 0.0319 | 2012/08/01 00:39:01 | 0B / 48B / 47B |
2 | shinh | 102 | 0.0340 | 2012/08/01 15:45:23 | 0B / 50B / 52B |
3 | nu(orz) | 103 | 0.0355 | 2012/07/31 13:06:36 | 8B / 47B / 48B |
4 | 0mg | 105 | 0.0325 | 2012/08/13 19:47:17 | 0B / 53B / 52B |
5 | ush (2hrs) | 108 | 0.0321 | 2012/07/31 12:49:41 | 8B / 49B / 51B |
6 | inaniwa(2hrs) | 111 | 0.0414 | 2012/07/31 12:34:30 | 9B / 48B / 54B |
7 | ush | 130 | 0.0368 | 2012/07/31 12:32:59 | 8B / 59B / 63B |
8 | Y.OHNO(2hrs) | 167 | 0.0319 | 2012/08/13 19:11:11 | 0B / 81B / 86B |
9 | inaniwa | 181 | 0.0583 | 2012/07/31 11:20:10 | 0B / 86B / 95B |
10 | peria | 376 | 0.0398 | 2012/07/31 16:01:06 | 16B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | henkma | 102 | 0.0439 | 2012/08/04 05:10:45 | 0B / 56B / 44B |
2 | rst76 | 103 | 0.0390 | 2012/08/07 22:24:30 | 0B / 51B / 50B |
3 | notogawa | 104 | 0.0499 | 2012/08/07 21:51:05 | 0B / 54B / 48B |
4 | rst76(2hrs) | 109 | 0.0566 | 2012/07/31 12:55:20 | 0B / 55B / 49B |
5 | Lost_dog | 158 | 0.0352 | 2012/08/01 22:18:57 | 0B / 68B / 85B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 166 | 0.0665 | 2012/08/04 23:51:08 | 0B / 46B / 109B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 41 | 0.3648 | 2012/08/01 20:58:43 | 0B / 9B / 32B |
2 | clock | 46 | 1.4782 | 2012/08/12 16:56:15 | 0B / 14B / 32B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | clock | 73 | 0.4658 | 2012/07/31 17:35:39 | 5B / 43B / 21B |
2 | clock(2hrs) | 83 | 0.7350 | 2012/07/31 12:23:01 | 7B / 41B / 28B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | GolfScript | tails | 41 | 10000 |
2 | Perl | nai | 45 | 9111 |
3 | J | I., S. | 51 | 8039 |
4 | K | teebee | 55 | 7454 |
5 | Ruby | leonid | 64 | 6406 |
6 | Vim | clock | 73 | 5616 |
7 | C | nu | 95 | 4315 |
8 | Arc | youz | 101 | 4059 |
9 | Haskell | henkma | 102 | 4019 |
10 | Python | leonid | 111 | 3693 |
11 | Lua | clock | 131 | 3129 |
12 | JavaScript | 0mg | 134 | 3059 |
13 | sed | tails | 166 | 2469 |
return to the top page