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:
<pre>"###" -> " "
"## " -> " "
"# #" -> " "
"# " -> "#"
" ##" -> "#"
" # " -> "#"
" #" -> "#"
" " -> " "</pre>
See <a href="http://mathworld.wolfram.com/Rule30.html">http://mathworld.wolfram.com/Rule30.html</a> 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
3tails (ySas,teebee)340.07312021/06/17 10:54:110B / 11B / 23B
4teebee(ySas)360.10502011/04/14 06:41:540B / 10B / 24B
5Sisyphus (ySas)360.07432021/03/20 14:32:570B / 10B / 24B
6BioFALSE730.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
8user_1700.09282020/11/29 07:38:200B / ?B / ?B

Python3 _

RankUserSizeTimeDateStatistics
1ant640.13742022/04/01 18:28:420B / ?B / ?B

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
7tails (hinoe)610.40012021/06/17 13:55:240B / 38B / 23B
8hinoe660.08972007/05/15 21:22:000B / 38B / 28B
951b750.08742007/05/14 17:16:170B / 37B / 35B
10inaniwa1920.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
3tails500.04462021/06/17 11:13:360B / 12B / 33B

Bash _

RankUserSizeTimeDateStatistics
1McBusLuck370.01992020/09/04 04:07:340B / 12B / 24B
2yamaya760.38942010/10/24 14:54:130B / 28B / 41B
3tabasa1250.12822007/11/15 16:40:030B / 55B / 64B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails (McBusLuck)750.21112020/09/04 09:18:290B / 30B / 41B
2McBusLuck810.13982020/09/04 04:00:240B / 32B / 45B

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
1tails140.33032021/06/17 14:32:166B / 6B / 2B
2whio180.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
1gs2tails1410000
2z80*yuko*207000
3GolfScriptflagitious245833
4BefungeMark Byers294827
5Perltails (ySas,teebee)344117
6BashMcBusLuck373783
7gorubymurky-satyr393589
8JI., S.(pooq)393589
9Rubyleonid (flag)423333
10sedtails502800
11PostscriptySas532641
12Vimnn582413
13AWKyamaya612295
14Ctails (hinoe)612295
15Groovymurky-satyr642187
16Python3ant642187
17JavaScriptnn652153
18PythonMark Byers672089
19PHPprimo692028
20Haskellnotogawa721944
21Forthzzo38741891
22Bash (builtins)tails (McBusLuck)751866
23Luamurky-satyr851647
24D51b871609
25BASIC*yuko*871609
26OCamlksk921521
27Iomurky-satyr991414
28Smalltalkmurky-satyr1001400
29Common LISPkozima1011386
30Fortran*yuko*1041346
31Schememurky-satyr1141228
32Tclmurky-satyr1171196
33Pascaluru1211157
34Erlang51b1331052
35Prologmskzzzz147952
36C#siokoshou160875
37AdaD166843
38Unlambdairori228614
39Lazy-K51b308454

Referer

Note that, they may contain spoilers.

return to the top page