Skip to main content
edited tags
Link
DLosc
  • 39.2k
  • 5
  • 83
  • 141
added 355 characters in body
Source Link
qwr
  • 12.3k
  • 6
  • 47
  • 80

For those who don't know, rule 110 is simulated line by line in a grid. Each square in a line of the grid looks at the squares above, above-left and above-right to determine what cell it should be.

Input: numbers from 0 to 39 representing top row nth input square, separated by commasin any reasonable format (comma-separated string, list, function arguments). To accommodate 1-indexed languages, numbers may also be 1-indexed and so range from 1 to 40.

Output: A 40 x 40 grid representing the automata running including the first row. You should leave 0 as blank and 1 as any visible printing character. Trailing spaces are allowed, as long as the actual grid can reasonably be distinguished. The bottom of the grid may have a newline but there should not be blank lines between grid lines.

For those who don't know, rule 110 is simulated line by line. Each square in a line looks at the squares above, above-left and above-right to determine what cell it should be.

Input: numbers from 0 to 39 representing top row nth input square, separated by commas.

Output: A 40 x 40 grid representing the automata running including the first row. You should leave 0 as blank and 1 as any character.

For those who don't know, rule 110 is simulated line by line in a grid. Each square in a line of the grid looks at the squares above, above-left and above-right to determine what cell it should be.

Input: numbers from 0 to 39 representing top row nth input square, in any reasonable format (comma-separated string, list, function arguments). To accommodate 1-indexed languages, numbers may also be 1-indexed and so range from 1 to 40.

Output: A 40 x 40 grid representing the automata running including the first row. You should leave 0 as blank and 1 as any visible printing character. Trailing spaces are allowed, as long as the actual grid can reasonably be distinguished. The bottom of the grid may have a newline but there should not be blank lines between grid lines.

Tweeted twitter.com/#!/StackCodeGolf/status/500093525502205952
added 24 characters in body
Source Link
qwr
  • 12.3k
  • 6
  • 47
  • 80

Rule 110 is a cellular automaton with some interesting properties. Your goal is to simulate a rule 110 in as few characters as possible.

For those who don't know, rule 110 is simulated line by line. Each square in a line looks at the squares above, above-left and above-right to determine what cell it should be.

current pattern  111 110 101 100 011 010 001 000
new cell          0   1   1   0   1   1   1   0

Input: numbers from 0 to 39 representing top row nth input square, separated by commas.

Example input:

38,39

Output: A 40 x 40 grid representing the automata running including the first row. You should leave 0 as blank and 1 as any character.

Example output:

                                  XX
                                 XXX
                                XX X
                               XXXXX
                              XX   X
                             XXX  XX
                            XX X XXX
                           XXXXXXX X
                          XX     XXX
                         XXX    XX X
                        XX X   XXXXX
                       XXXXX  XX   X
                      XX   X XXX  XX
                     XXX  XXXX X XXX

etc.

Note: A similar question about 1D cellular automata has already been asked, but I hope that, by using only one rule, shorter answers can be written.

Rule 110 is a cellular automaton with some interesting properties. Your goal is to simulate a rule 110 in as few characters as possible.

For those who don't know, rule 110 is simulated line by line. Each square in a line looks at the squares above, above-left and above-right to determine what cell it should be.

current pattern  111 110 101 100 011 010 001 000
new cell          0   1   1   0   1   1   1   0

Input: numbers from 0 to 39 representing top row nth input square, separated by commas.

Example input:

38,39

Output: A 40 x 40 grid representing the automata running. You should leave 0 as blank and 1 as any character.

Example output:

                                  XX
                                 XXX
                                XX X
                               XXXXX
                              XX   X
                             XXX  XX
                            XX X XXX
                           XXXXXXX X
                          XX     XXX
                         XXX    XX X
                        XX X   XXXXX
                       XXXXX  XX   X
                      XX   X XXX  XX
                     XXX  XXXX X XXX

etc.

Note: A similar question about 1D cellular automata has already been asked, but I hope that, by using only one rule, shorter answers can be written.

Rule 110 is a cellular automaton with some interesting properties. Your goal is to simulate a rule 110 in as few characters as possible.

For those who don't know, rule 110 is simulated line by line. Each square in a line looks at the squares above, above-left and above-right to determine what cell it should be.

current pattern  111 110 101 100 011 010 001 000
new cell          0   1   1   0   1   1   1   0

Input: numbers from 0 to 39 representing top row nth input square, separated by commas.

Example input:

38,39

Output: A 40 x 40 grid representing the automata running including the first row. You should leave 0 as blank and 1 as any character.

Example output:

                                  XX
                                 XXX
                                XX X
                               XXXXX
                              XX   X
                             XXX  XX
                            XX X XXX
                           XXXXXXX X
                          XX     XXX
                         XXX    XX X
                        XX X   XXXXX
                       XXXXX  XX   X
                      XX   X XXX  XX
                     XXX  XXXX X XXX

etc.

Note: A similar question about 1D cellular automata has already been asked, but I hope that, by using only one rule, shorter answers can be written.

Loading
deleted 14 characters in body
Source Link
qwr
  • 12.3k
  • 6
  • 47
  • 80
Loading
Source Link
qwr
  • 12.3k
  • 6
  • 47
  • 80
Loading