Fun Stuff · Graphics · Silverlight

John Conway’s Game of Life

Pulsar in the Game of Life

The Game of Life in Silverlight 4

http://paul.ennemoser.com/files/GameOfLife.zip

 

 

 


The Game of Life is another Cellular Automata. This automata consists of a two-dimensional grid of cells. By following simple rules interesting behaviour can emerge.

The default rules are as followed:

  1. Any live (black) cell with fewer than two live neighbours dies, as if by needs caused by underpopulation.
  2. Any live (black) cell with more than three live neighbours dies, as if by overcrowding.
  3. Any dead (white) cell with exactly three live neighbours becomes an live cell.

My implementation of Conway’s Game of Life allows you to add well known starting conditions which emerge into self-repeating (oscillating), chaotic and/or self-destructive patterns. You can also toggle the state of any cell by simply clicking it.

See also:
Source Code: https://github.com/tivtag/Silverlight.GameOfLife/
Wiki: http://en.wikipedia.org/wiki/Conway’s_Game_of_Life

Advertisements
Fun Stuff · Graphics · Silverlight · Uncategorized

Cellular Automata

Cellular Automata


http://paul.ennemoser.com/files/CellularAutomata.zip


A cellular automata consists of a grid of cells, with each cell having a number of states. The cells of the simple automata, that I’ve implemented in Silverlight, can have one of two states: On (Black) or Off (White).

Each row in the grid represents one generation (in this automata).
The state of a row depends on the state of the previous row, and so on.

A simple rule is used to generate the state of each cell of a row:
For each entry in the row we take the (N – 1th, Nth, N + 1th) cell triple
in the previous row.

Now we take this triple and use a lookup table to get the state of the entry.
Here are the lookup tables for two of the most famous patterns:

Rule 30 cellular automaton lookup table:

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

 

Rule 110 cellular automaton lookup table:

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

See the Wikipedia entry for more information.

Games · Silverlight

InvTetris – Inverse-Space Two-Player Tetris

Around one week ago I felt like working on a game that I could -actually- finish in a reasonable time-frame. This is the result:


InvTetris is a two-player Tetris game in which you play in your opponents’ space.

You can play the game here:
— Removed Link, you can play Two Way Box instead! —

I hope you’ll have some fun playing it~ (:

*** Controls ***
White:
Move Left       – A
Move Right    – D
Drop              – S
Turn Left       – C
Turn Right     – V

Black:
Move Left     – Left
Move Right   – Right
Push             – Up
Turn Left      – O
Turn Right    – P

To-Do:
1. Custom controls are going to be the implemented in the beta version of InvTetris, sorry for now!
2. Moving blocks after placing them is implemented, but still needs some tweaking before it can go live.

Credits:
I’d like to thank squidi for the original idea; visit his great website http://www.squidi.net/three/index.php
to read his game-ideas. NegSpace Puzzle

Fun Stuff · Silverlight

From Chaos to Order

 

Langton’s Ant 

Did you know that chaos can turn into ‘beautiful’ non-chaos?
Today we shall follow the journey of a simple life-form, our ant.

Try it here: http://paul.ennemoser.com/files/LangtonsAnt.zip

Imagine an ant-field made out of boxes, called cells.
Each cell may be either colored black or white.

At the start of the journey every cell is white,
but the cell of our little ant is black.

The algorithm, which moves our ant over the ant-field,
is as followed:

  1. Move Ant.
  2. The cell the Ant moved onto changes color (black -> white, white -> black)
  3. If the cell was black, then turn the Ant 90° left.
    If the cell was white, then turn the Ant 90° right.
  4. Start again at 1.

If we follow the ant on her journey she seems to generate a quite chaotic structure.
But suddenly at around 10000 steps the structure the ant is creating
turns into a non-chaotic, for-ever repeating structure.

This proves that a simple algorithm that produces a chaotic structure may infact change its behaviour to be non-chaotic.

See http://mathworld.wolfram.com/LangtonsAnt.html for a more in-depth explanation.

Surely nature uses this too!
Chaos <-> Non-Chaos