Autocell 2

I’ve updated Autocell to version 2. In addition to cleaning up the code, adding better error handling, and (I hope) improving the interface slightly, I’ve made the following changes to the rules:

  • You can now set cells to be drawn as images. Defining the image a cell should use is as simple as making a rule of “draw <CELLTYPE> <URL>” (See Langton’s Ant for example.)
  • The directions northeast, northwest, etc. have been added, as have fareast, farnorth, etc. The “far____” directions refer to cells two steps away.
  • The special noun “neighbors” now includes the NULL cells at the border.
  • New verbs “cellAt” and “neighborsOf” have been added. They both take a 2-by-1 array ([x,y]) of the cell in question as their right-parameter. The “cellAt” verb returns the type of the cell in question, while “neighborsOf” returns the set of neighbors.
  • A new two-parameter verb “+” has been added. Right now it only operates on the 2-by-1 coordinate arrays discussed above. (Example: [1,-10] + [23,7] = [24,-3])
  • In the same vein, a new special noun called “thisPos” has been added. It is the coordinates of the cell being evaluated.

That’s all!

This entry was posted in Code and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

4 Comments

  1. Posted May 29, 2010 at 9:44 am | Permalink

    Goopy water:

    EMPTY->BLUE: north = BLUE
    BLUE->EMPTY: south = EMPTY

    EMPTY->BLUE: not(west = EMPTY) and northwest = BLUE
    BLUE->EMPTY: not(south = EMPTY) and southeast = EMPTY

    EMPTY->BLUE: not(east = EMPTY) and northeast = BLUE and not(fareast = EMPTY)
    BLUE->EMPTY: not(south = EMPTY) and southwest = EMPTY

    EMPTY->BLUE: east = BLUE and not(fareast = EMPTY) and cellAt (thisPos + [2,-1]) = BLUE
    BLUE->EMPTY: not(south = EMPTY) and southwest = BLUE and cellAt (thisPos + [-2,1]) = EMPTY

    EMPTY->BLUE: west = BLUE and not(farwest = EMPTY) and cellAt (thisPos + [-2,-1]) = BLUE
    BLUE->EMPTY: not(south = EMPTY) and southeast = BLUE and cellAt (thisPos + [2,1]) = EMPTY

  2. jt
    Posted July 31, 2010 at 5:34 pm | Permalink

    this game is very cool and all but i find it wont work on internet explorer

  3. jt
    Posted July 31, 2010 at 5:35 pm | Permalink

    still awsome though

  4. Posted July 31, 2010 at 10:36 pm | Permalink

    Thanks! Also, I know about the IE thing. It’s because this is HTML5, and IE doesn’t support that yet.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>