Labyrinth. Rules!

For discussion of other cellular automata.
Post Reply
Naszvadi
Posts: 1248
Joined: May 7th, 2016, 8:53 am
Contact:

Labyrinth. Rules!

Post by Naszvadi » January 31st, 2018, 5:47 am

Code: Select all

@RULE ariadne

Fun with cellular automata, mino-tours
Naszvadi, Peter, 2018

@TABLE

# Format: C,N,E,S,W,C'

n_states:8
neighborhood:vonNeumann
symmetries:rotate4
var a={0,1,2,3,4,5,6,7}
var b={0,1,2,3,4,5,6,7}
var c={0,1,2,3,4,5,6,7}
var d={0,1,2,3,4,5,6,7}
var f={1,5}
var g={1,5}
var h={1,5}

# 1 = wall
# 2 = wanderer
# 3 = wanderer's last place
# 4 = path
# 5 = touched wall
# 6 = wanderer in dead end
# 7 = wanderer in crossroads

# dead end
4,2,f,g,h,6
3,6,a,b,c,2

# path change
4,2,4,4,4,7
4,6,4,4,4,7
4,2,f,a,g,2
4,2,a,f,g,2
4,5,a,b,7,2
3,6,4,4,4,7

# wall
5,a,b,c,d,1
1,2,a,b,c,5
1,6,a,b,c,5

# trail
3,a,b,c,d,4

# wanderer leaves
2,a,b,c,d,3
6,a,b,c,d,3
7,a,b,c,d,3

# other transitions
0,a,b,c,d,0
1,a,b,c,d,1
2,a,b,c,d,2
3,a,b,c,d,3
4,a,b,c,d,4
5,a,b,c,d,5
6,a,b,c,d,6
7,a,b,c,d,7

@COLORS

1 255 255 255
2 192 192 192
3 64 255 64
4 255 64 64
5 128 0 255
6 188 188 188
7 255 255 64
Example walkthrough (not all crossroads/short dead ends are handled correctly)

Code: Select all

x = 38, y = 38, rule = ariadne
3.3A3.3A3.3A3.3A3.3A3.3A$3.ADA3.ADA3.ADA3.ADA3.ADA3.ADA$3.ADA3.ADA3.A
DA3.ADA3.ADA3.ADA$4AD5AD5AD5AD5AD5AD3A$AB11DA11DA11DA$4AD5AD5AD5AD5AD
5AD3A$3.ADA3.ADA3.ADA3.ADA3.ADA3.ADA$3.3A3.ADA3.ADA3.ADA3.3A3.ADA$3.A
DA3.ADA3.ADA3.ADA3.ADA3.ADA$4AD5AD5AD5AD5AD5AD3A$A12DA5DA11DA5DA$4AD
5AD5AD5AD5AD5AD3A$3.ADA3.ADA3.ADA3.ADA3.ADA3.ADA$3.ADA3.3A3.3A3.ADA3.
ADA3.ADA$3.ADA3.ADA3.ADA3.ADA3.ADA3.ADA$4AD5AD5AD5AD5AD5AD3A$A18DA5DA
5DA5DA$4AD5AD5AD5AD5AD5AD3A$3.ADA3.ADA3.ADA3.ADA3.ADA3.ADA$3.3A3.ADA
3.ADA3.ADA3.ADA3.ADA$3.ADA3.ADA3.ADA3.ADA3.ADA3.ADA$4AD5AD5AD5AD5AD5A
D3A$A6DA5DA5DA5DA11DA$4AD5AD5AD5AD5AD5AD3A$3.ADA3.ADA3.ADA3.ADA3.ADA
3.ADA$3.ADA3.ADA3.3A3.ADA3.ADA3.3A$3.ADA3.ADA3.ADA3.ADA3.ADA3.ADA$4AD
5AD5AD5AD5AD5AD3A$A6DA11DA5DA11DA$4AD5AD5AD5AD5AD5AD3A$3.ADA3.ADA3.AD
A3.ADA3.ADA3.ADA$3.ADA3.3A3.ADA3.ADA3.3A3.ADA$3.ADA3.ADA3.ADA3.ADA3.A
DA3.ADA$4AD5AD5AD5AD5AD5AD3A$A24DA11D$4AD5AD5AD5AD5AD5AD3A$3.ADA3.ADA
3.ADA3.ADA3.ADA3.ADA$3.3A3.3A3.3A3.3A3.3A3.3A!
Mine o'tours :) Unoptimized, made in a hurry, just for fun, incomplete.

User avatar
jimmyChen2013
Posts: 184
Joined: December 11th, 2017, 3:28 am

Re: Labyrinth. Rules!

Post by jimmyChen2013 » January 31st, 2018, 9:37 pm

Try your's on my maze-gem rule

Code: Select all

@RULE Maze-gen

@TABLE
n_states:2
neighborhood:Moore
symmetries:rotate4reflect

var a = {0,1}
var b = {a}
var c = {a}
var d = {a}
var e = {a}
var f = {a}
var g = {a}
var h = {a}

0,0,0,0,0,0,0,0,0,0
1,1,1,1,1,1,1,1,1,1

0,a,1,1,1,c,0,0,0,1
1,a,0,0,0,c,1,1,1,0

0,1,1,1,b,0,0,0,c,1
1,0,0,0,b,1,1,1,c,0

0,0,1,0,1,0,0,0,0,1
1,1,0,1,0,1,1,1,1,0

0,1,a,1,b,1,c,1,0,1
1,0,a,0,b,0,c,0,1,0

0,1,1,1,1,1,1,1,1,1
1,0,0,0,0,0,0,0,0,0

0,1,0,1,1,1,0,1,1,1
1,0,1,0,0,0,1,0,0,0

0,1,0,1,1,1,1,1,1,1
1,0,1,0,0,0,0,0,0,0

0,1,0,0,0,1,0,0,0,1
1,0,1,1,1,0,1,1,1,0

0,0,1,1,0,1,0,1,1,1
1,1,0,0,1,0,1,0,0,0

1,0,a,1,1,1,b,0,1,0
0,1,a,0,0,0,b,1,0,1

0,0,0,1,0,1,1,1,a,1
1,1,1,0,1,0,0,0,a,0

1,0,1,1,1,a,1,1,1,0

@COLORS
0 255 255 255
1 0 0 0
(it doesn't really work that way, but just for fun lol :lol: )

Code: Select all

x = 8, y = 13, rule = B3aeiqr4-aijn5c6cei7/S2cn3-ajr4ceiqt5eijkq6-a7c8
2bo$b3o$5o$b5o$2b5o$3b5o$2b5o$b5o$5o$4o$3o$2o$o!

User avatar
dvgrn
Moderator
Posts: 10670
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Labyrinth. Rules!

Post by dvgrn » February 1st, 2018, 5:37 pm

Vaguely related -- here's a simplified copy of an early Golly rule for solving mazes, and a couple of Python scripts for generating test mazes, and some sample maze patterns -- from the Rule Table Repository.
MazeSolver2.zip
MazeSolver archive from 2009 (with updated rule file from 2013)
(35.35 KiB) Downloaded 260 times

Post Reply