Rule 30

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

Implement the cellular automation given by one generation of "rule 30." Strip dead cells (spaces) from beginning and end.

Each new cell is determined by the previous cell in the same spot and its two neighbors:

"###" -> " "
"## " -> " "
"# #" -> " "
"# " -> "#"
" ##" -> "#"
" # " -> "#"
" #" -> "#"
" " -> " "

See http://mathworld.wolfram.com/Rule30.html for more information.

Options

exec is denied

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

Sample input:_

##  #   #

Sample output:

## #### ###

Sample input:_

########     # # # # # # #     ## ## ## ## ##     #  #  #  #  #

Sample output:

##       #   ## # # # # # ##   ##  #  #  #  # #   ###############

Sample input:_

####  #   #####  ##  ### ##### ### ##  #    #   # #     #       # ## ###  # #   # # ## ### # # #    ###  #    ###  ###    ##  ### ###        # #       #  ######  #    #       #   # # #    # # #    # ###  #### #####   ### #  ## #     # #   ## #   #  #  #####   ###    #  # # #   ###   # ####   # #   #  # #### #   ####    # #  #   #   ##  # # ### ## #    ####    ###  ##  #  ####    ##       ### #  #  # ###     ## ##### ## # ## #  # #  ##  #     #  #  #   # # ####### ## ####  #### # ### # ##  ## ##### #########  ###   ##  ###       ##   ##### ######     #   # #  #    ##     ## #  ## #  ###   ##        ####  # #    #    #####  ## ##      ####  #####  ## ### ## ####### ##   ###  ## ##  ## #   # #   #   ##  ### #  #   # #  #   ### #  #      #    # ##########   #     # # # #   ##### ##   ### ###  #### #     # ####  ###       ## #    ## ####  #####      ### # ###  #   ## #  # #######  ## ##  ###   ###   ###  ### #####   #   #### #             # # #### # #    # #   # # # ### ##    #  ####  # #  #

Sample output:

##   #### ##    ### ###   #     #   # ####  ### ## ##   ###     ## #  #  ### ## ## # #  #   # # ##  ##  ####  ##  ###  #  ## ###   #  #      ## ##     #####     ####  ###     ### ## # ##  ## # ##  ## #  ###    #    # ##   ####  ##   ## ## ##  ## ########    # ##  #  ##### # ## ##  # ## #   # ## ## ##### #    ## ##   #  ## ##### ### ## ### # #   #  ##  ##   #  ##  ### ######   #  ## #     ##   ####### #  #   ##  #     #  # #  #### #### ####   ######### ## # #       #  #   ###    # #   # # ###  #     #        ###  # ## ###  #     ## # ##     #     #   ### ## #####  ## #   ##  ####  ####  # ## #      ##   ### ##  ###  ##    ###  # #    ##   ###    ###  #   #  #       # # ##  ###  # ###  ## ## ## ### ## ###   ##### ## ##### ##   #####    ###  ## #         # ###   ## # # ## ##     # # ##   #  ###    ##   ## #   ###  #     ##  ##  ##  #   ###    #    ##   # #  #### ##  #### #      ###  # ###  # ##  # ##  ###   #    # ### ##    ##           ## # #    # ##  ## ## ## # # #   # #  #####   ### #####

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1flagitious440.44422007/05/12 00:49:330B / 24B / 18B
2ySas450.29002007/05/09 18:16:110B / 13B / 32B
3Mark Byers470.52422007/05/09 06:00:330B / 15B / 30B
4shinh490.45602007/05/08 14:57:500B / 14B / 31B
5ksk510.35942007/05/09 23:12:080B / 24B / 24B
6flagitious(sym)530.30842007/05/12 08:36:540B / 4B / 47B
7eban650.40582007/05/14 02:22:100B / 21B / 35B
8leonid (flag)420.03302010/09/10 09:50:070B / 23B / 18B
9Mark Byers440.29002007/05/16 14:39:280B / 10B / 34B
10Servo600.35202007/06/08 14:24:070B / 21B / 36B
11tabasa1160.09722007/11/15 16:35:200B / 50B / 61B

Perl _

RankUserSizeTimeDateStatistics
1ySas370.13332007/05/08 22:28:351B / 8B / 26B
2shinh500.19972007/05/08 15:04:530B / 13B / 33B
3teebee(ySas)360.10502011/04/14 06:41:540B / 10B / 24B
4BioFALSE730.03812013/01/29 19:51:310B / 19B / 45B

Python _

RankUserSizeTimeDateStatistics
1kt3k700.32872007/05/11 23:20:540B / 22B / 40B
2Mark Byers710.33372007/05/09 06:09:040B / 30B / 31B
3zetamatta730.35882007/05/09 10:58:050B / 32B / 31B
4flagitious780.31772007/05/12 05:07:340B / 34B / 32B
5SeeNoEvil830.33242007/05/11 07:24:550B / 41B / 29B
6mskzzzz890.39102007/05/13 00:02:270B / 34B / 40B
7Mark Byers670.32002007/05/14 14:01:230B / 22B / 36B

PHP _

RankUserSizeTimeDateStatistics
1primo690.10812012/01/07 20:33:401B / 28B / 36B

Scheme _

RankUserSizeTimeDateStatistics
1murky-satyr1140.53192008/07/12 00:55:130B / 52B / 55B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima1101.42132007/05/13 23:36:050B / 47B / 50B
2kozima1010.24442007/09/26 15:59:270B / 44B / 47B

Io _

RankUserSizeTimeDateStatistics
1murky-satyr992.57942008/07/12 01:07:250B / 56B / 33B

JavaScript _

RankUserSizeTimeDateStatistics
1nn650.11312012/05/24 23:25:480B / 36B / 25B
2murky-satyr710.09382007/09/19 07:08:070B / 31B / 36B
3Tomac1090.00982011/09/28 20:57:170B / ?B / ?B

Lua _

RankUserSizeTimeDateStatistics
1planque1360.11282007/05/14 02:59:530B / 50B / 63B
2murky-satyr850.07212008/07/30 04:28:320B / 43B / 35B
3rickrickrick1090.11612007/07/23 21:19:210B / 48B / 53B

Tcl _

RankUserSizeTimeDateStatistics
1murky-satyr1170.15572008/07/12 01:20:500B / 49B / 45B

Smalltalk _

RankUserSizeTimeDateStatistics
1murky-satyr1000.80932008/07/07 06:58:060B / 52B / 41B

Prolog _

RankUserSizeTimeDateStatistics
1mskzzzz1470.40832007/05/22 22:06:520B / 72B / 74B

Forth _

RankUserSizeTimeDateStatistics
1zzo38740.12352011/05/14 09:46:220B / 44B / 12B
251b800.10002007/12/08 01:17:240B / 50B / 12B

BASIC _

RankUserSizeTimeDateStatistics
1*yuko*870.22142009/08/23 20:23:120B / 42B / 37B

Erlang _

RankUserSizeTimeDateStatistics
151b1330.89352007/12/10 19:13:530B / 57B / 64B

J _

RankUserSizeTimeDateStatistics
1I., S.(pooq)390.10052011/10/29 23:22:340B / 11B / 27B
2I., S.420.11702011/02/27 21:29:500B / 14B / 25B
3pooq530.18912009/10/01 11:47:000B / 13B / 38B
4medialuna940.07912014/08/26 05:28:380B / ?B / ?B

C _

RankUserSizeTimeDateStatistics
1m.ukai770.08872007/05/11 15:58:350B / 35B / 38B
2hinoe(another)770.08512007/05/13 17:28:280B / 39B / 37B
3shinh780.07662007/05/08 16:57:270B / 39B / 36B
451b950.08892007/05/12 17:38:120B / 50B / 44B
5hinoe1040.10562007/05/13 18:16:540B / 51B / 50B
67gyou1070.07512007/05/08 23:35:070B / 54B / 52B
7hinoe660.08972007/05/15 21:22:000B / 38B / 28B
851b750.08742007/05/14 17:16:170B / 37B / 35B
9inaniwa1920.00122009/12/19 22:05:2611B / 70B / 76B

D _

RankUserSizeTimeDateStatistics
151b870.04062007/12/08 01:18:360B / 58B / 26B
251b 890.06802007/12/08 01:36:120B / 55B / 30B

OCaml _

RankUserSizeTimeDateStatistics
1ksk930.62472007/05/13 13:23:270B / 49B / 39B
2m.ukai940.28142007/05/11 15:10:060B / 49B / 35B
3ksk920.26172007/05/14 06:50:390B / 46B / 38B

Haskell _

RankUserSizeTimeDateStatistics
1notogawa800.11852007/05/13 18:28:150B / ?B / ?B
2moriA800.10062007/05/14 01:59:350B / 31B / 39B
3notogawa720.12422007/05/14 20:57:120B / 27B / 36B

Ada _

RankUserSizeTimeDateStatistics
1D1660.18902007/05/08 15:08:080B / 101B / 46B

Pascal _

RankUserSizeTimeDateStatistics
1uru1210.15662009/07/08 21:41:250B / 66B / 46B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*1040.04352012/01/09 13:53:200B / 59B / 39B

C# _

RankUserSizeTimeDateStatistics
1siokoshou1600.80182007/05/12 00:34:070B / 87B / 62B

AWK _

RankUserSizeTimeDateStatistics
1yamaya610.06702007/05/09 21:59:580B / 19B / 38B
2zetamatta910.15762007/05/09 11:43:060B / 38B / 48B

sed _

RankUserSizeTimeDateStatistics
1emoken580.09712007/05/11 20:54:500B / 5B / 42B
2shinh600.09882007/05/08 15:41:310B / 9B / 34B

Bash _

RankUserSizeTimeDateStatistics
1yamaya760.38942010/10/24 14:54:130B / 28B / 41B
2tabasa1250.12822007/11/15 16:40:030B / 55B / 64B

Postscript _

RankUserSizeTimeDateStatistics
1ySas570.87742007/05/13 21:10:5819B / 18B / 17B
2yshl(bin)890.85522007/05/13 09:39:2834B / 31B / 23B
3yshl1640.85902007/05/13 09:39:160B / 117B / 22B
4ySas531.09762007/05/14 17:16:0514B / 13B / 24B
5yshl(bin)530.56132007/12/08 02:17:2328B / 15B / 9B
6ySas(not bin)771.12102007/05/14 17:16:400B / 47B / 22B
7yshl911.08302007/05/14 15:17:320B / 63B / 16B

Befunge _

RankUserSizeTimeDateStatistics
1ySas370.09332007/05/11 17:53:150B / 10B / 21B
2Mark Byers290.13732007/05/17 00:27:050B / 6B / 22B

GolfScript _

RankUserSizeTimeDateStatistics
1flagitious240.92722007/12/16 14:47:450B / 6B / 16B

gs2 _

RankUserSizeTimeDateStatistics
1whio180.30632017/02/16 01:32:218B / 6B / 3B

Unlambda _

RankUserSizeTimeDateStatistics
1irori2280.01972007/05/13 01:13:320B / 109B / 118B

Lazy-K _

RankUserSizeTimeDateStatistics
151b3080.14822008/10/05 17:23:010B / 158B / 150B

z80 _

RankUserSizeTimeDateStatistics
1*yuko*200.13272012/03/05 03:21:5314B / 4B / 2B
2kik210.13852007/12/31 00:54:4215B / ?B / ?B
3yaneurao250.67842007/12/30 16:02:0016B / ?B / ?B
4kodera260.68382007/12/19 02:00:0317B / 4B / 4B

Vim _

RankUserSizeTimeDateStatistics
1nn580.29292010/01/22 17:46:474B / 23B / 21B

goruby _

RankUserSizeTimeDateStatistics
1murky-satyr390.44952008/09/11 15:39:300B / 20B / 17B

Groovy _

RankUserSizeTimeDateStatistics
1murky-satyr6411.60012008/07/07 04:01:020B / 33B / 31B

Language Ranking_

RankLangUserSizeScore
1gs2whio1810000
2z80*yuko*209000
3GolfScriptflagitious247500
4BefungeMark Byers296206
5Perlteebee(ySas)365000
6gorubymurky-satyr394615
7JI., S.(pooq)394615
8Rubyleonid (flag)424285
9PostscriptySas533396
10sedemoken583103
11Vimnn583103
12AWKyamaya612950
13Groovymurky-satyr642812
14JavaScriptnn652769
15Chinoe662727
16PythonMark Byers672686
17PHPprimo692608
18Haskellnotogawa722500
19Forthzzo38742432
20Bashyamaya762368
21Luamurky-satyr852117
22D51b872068
23BASIC*yuko*872068
24OCamlksk921956
25Iomurky-satyr991818
26Smalltalkmurky-satyr1001800
27Common LISPkozima1011782
28Fortran*yuko*1041730
29Schememurky-satyr1141578
30Tclmurky-satyr1171538
31Pascaluru1211487
32Erlang51b1331353
33Prologmskzzzz1471224
34C#siokoshou1601125
35AdaD1661084
36Unlambdairori228789
37Lazy-K51b308584

Referer

Note that, they may contain spoilers.

return to the top page