Gray code

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Print n-bit gray code.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

3

Sample output:

Gray code  n=3
000
001
011
010
110
111
101
100

Sample input:_

4

Sample output:

Gray code  n=4
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000

Sample input:_

7

Sample output:

Gray code  n=7
0000000
0000001
0000011
0000010
0000110
0000111
0000101
0000100
0001100
0001101
0001111
0001110
0001010
0001011
0001001
0001000
0011000
0011001
0011011
0011010
0011110
0011111
0011101
0011100
0010100
0010101
0010111
0010110
0010010
0010011
0010001
0010000
0110000
0110001
0110011
0110010
0110110
0110111
0110101
0110100
0111100
0111101
0111111
0111110
0111010
0111011
0111001
0111000
0101000
0101001
0101011
0101010
0101110
0101111
0101101
0101100
0100100
0100101
0100111
0100110
0100010
0100011
0100001
0100000
1100000
1100001
1100011
1100010
1100110
1100111
1100101
1100100
1101100
1101101
1101111
1101110
1101010
1101011
1101001
1101000
1111000
1111001
1111011
1111010
1111110
1111111
1111101
1111100
1110100
1110101
1110111
1110110
1110010
1110011
1110001
1110000
1010000
1010001
1010011
1010010
1010110
1010111
1010101
1010100
1011100
1011101
1011111
1011110
1011010
1011011
1011001
1011000
1001000
1001001
1001011
1001010
1001110
1001111
1001101
1001100
1000100
1000101
1000111
1000110
1000010
1000011
1000001
1000000

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1ksk640.06902009/05/28 01:16:520B / 31B / 30B
2leonid640.07652009/05/28 22:17:040B / 30B / 31B
3primo660.04492009/05/28 03:07:200B / 32B / 31B
4kinaba660.13462009/05/31 16:03:070B / 32B / 31B
5shinh660.07422009/06/02 00:34:360B / 32B / 31B
6mokos660.07572009/06/04 00:17:230B / ?B / ?B
7tryeng680.03442009/05/28 07:11:410B / 35B / 30B
8hallvabo680.04642009/05/29 01:07:330B / 34B / 31B
9uru690.08222009/05/27 20:58:290B / 35B / 28B
10tabasa720.04032009/06/04 17:33:420B / ?B / ?B
11samuil730.10782009/06/04 18:15:521B / 40B / 28B
12kaki720.07322009/06/24 16:47:370B / 36B / 32B

Perl _

RankUserSizeTimeDateStatistics
1ySas610.26182009/06/09 21:08:300B / 25B / 32B
2primo630.05572009/05/28 03:58:290B / 28B / 29B
3Mithran630.09992009/05/28 23:19:150B / 27B / 32B
4shinh650.03452009/06/02 00:52:330B / 27B / 34B
5tails (ySas)600.06752011/05/14 02:20:210B / 25B / 31B
6jonathan camacho1720.03832014/09/10 10:17:240B / 71B / 97B

Python _

RankUserSizeTimeDateStatistics
1primo860.13392009/05/28 05:08:290B / 46B / 33B
2tryeng1010.28832009/05/28 02:53:020B / 55B / 38B
3hallvabo1010.10582009/05/28 03:35:550B / 59B / 30B
4yanbe1120.21562009/05/31 14:46:260B / ?B / ?B
5_1200.11102009/05/31 14:39:420B / ?B / ?B
6Sasa1250.17212009/06/02 07:39:280B / 65B / 43B
7mitchs (phoenixstarhiro)830.10252014/06/10 04:20:480B / 52B / 21B
8phoenixstarhiro840.09722014/06/09 00:38:550B / ?B / ?B
9_860.10112014/06/09 00:36:450B / ?B / ?B

PHP _

RankUserSizeTimeDateStatistics
1logica760.18932009/06/16 23:01:191B / ?B / ?B
2primo(<_<)780.14712009/06/12 09:47:090B / 38B / 36B
318kb810.13622009/06/11 20:45:451B / ?B / ?B

Scheme _

RankUserSizeTimeDateStatistics
1pla1230.60452009/06/03 07:42:410B / 72B / 41B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima960.90302009/06/02 14:00:440B / 54B / 32B
2youz1030.26332009/05/29 17:48:450B / 64B / 28B
3ttmh950.09882015/05/31 17:14:550B / 54B / 32B

LilyPond _

RankUserSizeTimeDateStatistics
1KirarinSnow1142.29842009/12/16 03:33:520B / 61B / 42B

Io _

RankUserSizeTimeDateStatistics
1murky-satyr1052.61092009/06/07 05:49:473B / 61B / 37B
251b1051.18702009/06/07 21:47:473B / 64B / 32B
3pooq1250.95572009/05/27 18:01:500B / 83B / 33B

JavaScript _

RankUserSizeTimeDateStatistics
1murky-satyr920.08142009/06/01 02:24:310B / 45B / 44B
2nn920.10252009/06/01 23:22:510B / 55B / 32B
351b920.54032009/06/04 23:18:310B / 53B / 36B

Prolog _

RankUserSizeTimeDateStatistics
1pooq1220.15392009/05/27 19:47:490B / 65B / 49B
2pooq1100.36212012/03/05 10:15:160B / 58B / 44B

Forth _

RankUserSizeTimeDateStatistics
151b1210.03512009/05/30 17:14:240B / 64B / 18B

BASIC _

RankUserSizeTimeDateStatistics
1*yuko*730.09012009/05/27 03:27:520B / 45B / 23B
2pooq760.10452009/05/27 12:26:470B / 45B / 24B

Erlang _

RankUserSizeTimeDateStatistics
151b1581.14632009/06/06 22:55:020B / 77B / 71B

J _

RankUserSizeTimeDateStatistics
1pooq580.68312009/05/28 22:32:230B / 26B / 28B
2I., S.(pooq)540.11772011/05/13 21:11:250B / 25B / 24B
3I., S.560.12232011/05/13 20:15:320B / 22B / 30B

C _

RankUserSizeTimeDateStatistics
1*yuko*900.05002009/06/08 21:15:200B / 45B / 42B
2hinoe910.00052009/06/08 20:36:090B / 46B / 42B
3kik950.03452009/06/04 21:04:460B / 48B / 44B
451b950.03562009/06/04 21:13:030B / 48B / 44B
5letter950.04512009/06/06 23:27:340B / 47B / 45B
6kinaba990.04572009/06/04 17:51:340B / 51B / 45B
7kurimura990.00062009/06/06 15:01:140B / 51B / 45B
8shinh1000.05972009/06/02 03:28:290B / 45B / 52B
9ozy4dm1000.08812009/06/06 20:32:560B / 48B / 49B
10test1010.02092009/06/05 21:05:110B / 53B / 45B
11Robert1050.08172009/06/01 23:07:440B / 57B / 45B
12notogawa1050.06812009/06/05 00:46:030B / 50B / 52B
13pi80271060.05012009/06/01 21:14:530B / 54B / 49B
14nn1080.02882009/06/06 19:26:070B / 57B / 48B
15chocobi1080.04492009/06/06 23:04:370B / 63B / 42B
16sawakami1090.04022009/06/07 22:30:360B / 56B / 50B
177gyou1120.06182009/06/03 00:57:260B / 62B / 47B
18murky-satyr1150.03602009/06/02 01:14:370B / 63B / 49B
19pascal1150.04242009/06/06 05:56:490B / ?B / ?B
20naoya_t1160.05972009/06/06 01:54:370B / 63B / 49B
21schrodin1180.05222009/06/09 00:19:210B / 60B / 55B
22yuyarin1190.06532009/05/31 00:40:400B / ?B / ?B
23eagletmt1200.07392009/06/06 10:53:330B / ?B / ?B
24knct-cs1220.11892009/06/08 20:45:330B / 65B / 54B
25tester1230.05372009/06/04 21:00:180B / ?B / ?B
26risou1250.05462009/06/01 00:52:410B / ?B / ?B
27uru1260.05942009/06/02 18:41:400B / 66B / 56B
28Raider1290.07492009/06/05 23:21:390B / 68B / 58B
29hallvabo1300.06202009/05/28 21:54:590B / 68B / 58B
30haya1390.03582009/06/01 02:01:320B / ?B / ?B
31pi8027 (recur)1410.04072009/05/31 23:42:320B / 78B / 59B
32eldesh1590.06922009/06/09 14:14:180B / 81B / 63B
33pybot2200.05252009/06/05 00:33:570B / 107B / 106B
34orange11223130.04582009/06/02 23:08:143B / 158B / 142B
35ozy4dm(*yuko*|kurimura)880.00132009/06/10 11:35:050B / 44B / 41B
36nozuru1010.05192009/06/15 13:56:080B / ?B / ?B
37hess1180.00112010/02/12 16:33:280B / 62B / 53B
38inaniwa1830.00102009/12/17 17:30:3711B / 66B / 66B
39_2050.05192009/06/10 00:44:5416B / ?B / ?B
40ymkn2050.04412009/06/10 00:46:1616B / ?B / ?B

D _

RankUserSizeTimeDateStatistics
151b1110.07202009/06/06 22:46:060B / 68B / 36B
2kurimura1140.09832009/06/07 09:19:550B / 73B / 35B
3komono1170.12322009/06/05 02:54:200B / 74B / 36B

OCaml _

RankUserSizeTimeDateStatistics
1ksk1410.98922009/08/14 17:42:560B / 81B / 52B

Haskell _

RankUserSizeTimeDateStatistics
1notogawa980.07122009/05/27 21:16:430B / ?B / ?B
2ho1150.03442014/02/06 16:54:070B / ?B / ?B

Java _

RankUserSizeTimeDateStatistics
1uru2080.74992009/05/27 23:36:050B / 146B / 53B
2Patashu (looked it up)2210.70652009/05/27 23:59:530B / ?B / ?B
3Patashu3080.49372009/05/27 22:48:430B / ?B / ?B
4teebee1570.43792011/02/10 06:54:120B / 90B / 62B
5Patashu1720.28162010/04/21 16:12:080B / 110B / 57B

Pascal _

RankUserSizeTimeDateStatistics
1uru1370.22992009/06/06 21:15:340B / 90B / 32B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*970.07692009/05/28 05:27:470B / 55B / 39B
2*yuko*900.00122009/12/31 19:07:120B / 48B / 39B

C# _

RankUserSizeTimeDateStatistics
1siokoshou1770.53112009/08/06 17:28:080B / 118B / 51B

COBOL _

RankUserSizeTimeDateStatistics
1*yuko*2800.03742011/05/13 01:37:470B / 199B / 34B

Maxima _

RankUserSizeTimeDateStatistics
1pooq990.75972009/08/09 12:03:530B / 51B / 43B

AWK _

RankUserSizeTimeDateStatistics
1nn860.05872009/05/30 11:18:370B / 42B / 40B

m4 _

RankUserSizeTimeDateStatistics
151b1390.13142009/06/04 23:21:100B / 78B / 57B

Postscript _

RankUserSizeTimeDateStatistics
1ySas661.09832009/05/31 01:55:3016B / 31B / 15B
2yshl(bin)661.15272009/06/02 01:19:5621B / 30B / 11B
3yshl1151.21702009/05/31 19:33:460B / 83B / 15B

GolfScript _

RankUserSizeTimeDateStatistics
1strager470.26012009/10/25 11:38:350B / 21B / 23B

gs2 _

RankUserSizeTimeDateStatistics
1whio370.25232017/03/17 00:02:018B / 19B / 5B

Burlesque _

RankUserSizeTimeDateStatistics
1Hendrik620.04552014/06/09 03:38:130B / 25B / 34B

Universal Lambda _

RankUserSizeTimeDateStatistics
1hinoe700.20692009/05/28 19:21:2037B / 20B / 8B

z80 _

RankUserSizeTimeDateStatistics
1kodera500.15432009/05/31 22:29:4624B / 11B / 9B
2ySas560.90352009/06/03 22:06:3233B / 11B / 9B

Vim _

RankUserSizeTimeDateStatistics
1pla490.07812010/03/16 05:24:197B / 29B / 9B
2nn1590.89632009/10/29 11:04:3111B / 82B / 57B

Groovy _

RankUserSizeTimeDateStatistics
1nn959.97292009/05/30 10:23:460B / 59B / 30B

Language Ranking_

RankLangUserSizeScore
1gs2whio3710000
2GolfScriptstrager477872
3Vimpla497551
4z80kodera507400
5JI., S.(pooq)546851
6Perltails (ySas)606166
7BurlesqueHendrik625967
8Rubyksk645781
9PostscriptySas665606
10Universal Lambdahinoe705285
11BASIC*yuko*735068
12PHPlogica764868
13Pythonmitchs (phoenixstarhiro)834457
14AWKnn864302
15Cozy4dm(*yuko*|kurimura)884204
16Fortran*yuko*904111
17JavaScriptmurky-satyr924021
18Groovynn953894
19Common LISPttmh953894
20Haskellnotogawa983775
21Maximapooq993737
22Iomurky-satyr1053523
23Prologpooq1103363
24D51b1113333
25LilyPondKirarinSnow1143245
26Forth51b1213057
27Schemepla1233008
28Pascaluru1372700
29m451b1392661
30OCamlksk1412624
31Javateebee1572356
32Erlang51b1582341
33C#siokoshou1772090
34COBOL*yuko*2801321

return top