May 25, 2010

The Queen’s Speech

Today was the day of the Queen’s speech where she outlines the bills to be put forward in the new parliament.

Amongst them was a bill to scrap biometric passports, identity cards (hooray!) and limit the data that can be held about an individual.

I have a plan to take this even further: no personal data of any kind can be held about a person, BUT everyone must wear a T-Shirt proclaiming one embarrassing aspect of their views or past. For example:

“Evolution denier”

“Second cousin of G.W. Bush”

“Believes in fairies”

“Doesn’t like black people” (see how long the person wearing that one lasts…)

“Supported the war in Iraq”

“Cannot wee in the presence of others”

In addition to giving us all a good laugh, I believe this will help to bring us together as people. At the least it’s a lot more interesting than most of the proposals in the Queen’s speech, anyway.

komakino @ 1:20 pm

October 28, 2009

Conway’s Game of Life (in Java)

Just recently I’ve become interested in Conway’s Game of Life. Basically it’s a set of rules governing the life cycle of cellular automata. Even more basically it’s a 2D grid where the number of living cells around another cell decide whether it lives or dies (or comes to life).

For example: imagine a chess board. Now pick a square. If that square has fewer than 2 living neighbours (the 8 surrounding squares) then it either stays or becomes dead, as if from lonliness. If it has more than 4 living neighbours then it dies, as if from overcrowding. If it has exactly 2 or 3 living neighbours and is already alive then it stays alive. If it has exactly 3 living neighbours and it was dead then it becomes alive.

And that’s it. But because it plays out over many turns (or iterations) it allows for certain patterns to repeat, or entire formations to move across the grid as cells become dead or alive in turn.

Anyway, my fascination with this led me to write a small Java game of life simulator. I’ve provided the code here

It’s not good or tidy code, but it might interest you if you’re a starting programmer.

Game of Life with 3 Gliders

Game of Life with 3 Gliders

An interesting shape to start off with is the glider (O is dead, X is alive):

OOX

XOX

OXX

put that in the top left and it will move diagonally down and right.

Experiment and have fun :)

Filed under: musings
Tags: , ,
komakino @ 10:34 pm

Older Posts »
x