/* * The Jacciata automaton, expressed in ALPACA. * Inspired by Jaccia. * April 11 2009, Chris Pressey, Cat's Eye Technologies. */ class Starter; class Sustainer; class Sassy; class Solution; state Space " "; state Wall "#"; /* purely decorative */ /* * Slime stays alive so long as there is sustenance (food, or more slime, or the * head of an exploratory shoot) on at least two sides. Slime turns into an * exploratory head if there is adjacent starter material. */ state Slime "%" is Sustainer to Space when not ((^ is Sustainer and > is Sustainer) or (^ is Sustainer and v is Sustainer) or (^ is Sustainer and < is Sustainer) or (> is Sustainer and v is Sustainer) or (> is Sustainer and < is Sustainer) or (v is Sustainer and < is Sustainer)) or /* this part lets conflicts be resolved */ ((^ Head and > Head) or (^ Head and v Head) or (^ Head and < Head) or (> Head and v Head) or (> Head and < Head) or (v Head and < Head)), to Head when (v is Starter or ^ is Starter or > is Starter or < is Starter); state Head "-" is Starter is Sustainer is Sassy to Body; /* * Body does not provide sustenance for slime. * Body becomes solved cells when adjacent to a solution. * Body stays alive so long as there is sassy on at least two sides; * sassy is head, more body, or food, or a solved cell. */ state Body "?" is Starter is Sassy to Solved when (v is Solution or ^ is Solution or > is Solution or < is Solution), to Space when not ((^ is Sassy and > is Sassy) or (^ is Sassy and v is Sassy) or (^ is Sassy and < is Sassy) or (> is Sassy and v is Sassy) or (> is Sassy and < is Sassy) or (v is Sassy and < is Sassy)); /* * Solved cells survive on the same rules as body cells. */ state Solved "@" is Sassy is Solution to Space when not ((^ is Sassy and > is Sassy) or (^ is Sassy and v is Sassy) or (^ is Sassy and < is Sassy) or (> is Sassy and v is Sassy) or (> is Sassy and < is Sassy) or (v is Sassy and < is Sassy)); state Start "S" is Starter is Sustainer is Sassy; state Finish "F" is Sustainer is Sassy is Solution.