Skip to main content
deleted 2 characters in body
Source Link
Ventero
  • 10.1k
  • 3
  • 24
  • 55

Ruby, 118113 characters

c=[0]*41
eval("[#eval"[#{gets}]")].map{|i|c[i]=1}"+'
c=(r=00..39).map{c=r.map{|x|putc" X"[u=c[x]]
110[4*c[x-1]+2*u+c[x+1]]}<<0;puts}<<0;puts'*40

Ruby, 118 characters

c=[0]*41
eval("[#{gets}]").map{|i|c[i]=1}
(r=0..39).map{c=r.map{|x|putc" X"[u=c[x]]
110[4*c[x-1]+2*u+c[x+1]]}<<0;puts}

Ruby, 113 characters

c=[0]*41
eval"[#{gets}].map{|i|c[i]=1}"+'
c=(0..39).map{|x|putc" X"[u=c[x]]
110[4*c[x-1]+2*u+c[x+1]]}<<0;puts'*40
deleted 10 characters in body
Source Link
Ventero
  • 10.1k
  • 3
  • 24
  • 55

Ruby, 128118 characters

c=[0]*41
eval("[#{gets}]").map{|i|c[i]=1}
(r=0..39).map{puts rc=r.map{|i|"|x|putc" X"[c[i]]}*""X"[u=c[x]]
c=r.map{|x|110[4*c[x110[4*c[x-1]+2*c[x]+c[x+1]]1]+2*u+c[x+1]]}<<0<<0;puts}

Ruby, 128 characters

c=[0]*41
eval("[#{gets}]").map{|i|c[i]=1}
(r=0..39).map{puts r.map{|i|" X"[c[i]]}*""
c=r.map{|x|110[4*c[x-1]+2*c[x]+c[x+1]]}<<0}

Ruby, 118 characters

c=[0]*41
eval("[#{gets}]").map{|i|c[i]=1}
(r=0..39).map{c=r.map{|x|putc" X"[u=c[x]]
110[4*c[x-1]+2*u+c[x+1]]}<<0;puts}
Source Link
Ventero
  • 10.1k
  • 3
  • 24
  • 55

Ruby, 128 characters

c=[0]*41
eval("[#{gets}]").map{|i|c[i]=1}
(r=0..39).map{puts r.map{|i|" X"[c[i]]}*""
c=r.map{|x|110[4*c[x-1]+2*c[x]+c[x+1]]}<<0}

Takes input on stdin. To use a different rule, simply replace the 110 in the last line with whatever rule you want to try.

Example:

$ ruby 110.rb <<< 38,39
                                      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
                        XX X XX  XXXXX X
                       XXXXXXXX XX   XXX
                      XX      XXXX  XX X
                     XXX     XX  X XXXXX
                    XX X    XXX XXXX   X
                   XXXXX   XX XXX  X  XX
                  XX   X  XXXXX X XX XXX
                 XXX  XX XX   XXXXXXXX X
                XX X XXXXXX  XX      XXX
               XXXXXXX    X XXX     XX X
              XX     X   XXXX X    XXXXX
             XXX    XX  XX  XXX   XX   X
            XX X   XXX XXX XX X  XXX  XX
           XXXXX  XX XXX XXXXXX XX X XXX
          XX   X XXXXX XXX    XXXXXXXX X
         XXX  XXXX   XXX X   XX      XXX
        XX X XX  X  XX XXX  XXX     XX X
       XXXXXXXX XX XXXXX X XX X    XXXXX
      XX      XXXXXX   XXXXXXXX   XX   X
     XXX     XX    X  XX      X  XXX  XX
    XX X    XXX   XX XXX     XX XX X XXX
   XXXXX   XX X  XXXXX X    XXXXXXXXXX X
  XX   X  XXXXX XX   XXX   XX        XXX
 XXX  XX XX   XXXX  XX X  XXX       XX X
XX X XXXXXX  XX  X XXXXX XX X      XXXXX
XXXXXX    X XXX XXXX   XXXXXX     XX   X