Skip to content

Create 2D images of elementary cellular automata using a simple GET-based API.

Notifications You must be signed in to change notification settings

algoristic/automata-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation


automata-api

Create 2D images of elementary cellular automata using a simple GET-based API.

Contents

  1. 🚀 Usage Examples
  2. 📝 Documentation



🚀 Usage Examples

Rule 30 for 256 cells in 256 generations:

https://algoristic.de/automata/30/256

Rule 30 for 256 cells in 256 generations


Rule 30 for 192 cells in 108 generations:

https://algoristic.de/automata/30/192/108

Rule 30 for 192 cells in 108 generations


Rule 30 for 192 cells in 108 generations and each cell scaled to occupy 10×10 pixels (resulting in a 1920×1080 image):

https://algoristic.de/automata/30/192/108?k=10

Rule 30 for 192 cells in 108 generations and each cell scaled to occupy 10×10 pixels


Rule 110 for 256 cells in 256 generations with an ever-changing random start configuration:

https://algoristic.de/automata/110/256/256/random

Rule 110 for 256 cells in 256 generations with an ever-changing random start configuration


Rule 30 for 256 cells in 256 generations with a fixed seeded start configuration:

https://algoristic.de/automata/30/256/256/1337

Rule 30 for 256 cells in 256 generations with a fixed seeded start configuration


Rule 30 for 256 cells in 256 generations and a fixed file name for browser caching:

https://algoristic.de/automata/30/256/rule_30.webp

Rule 30 for 256 cells in 256 generations and a fixed file name for browser caching


Rule 30 for 256 cells in 256 generations with living cells in pink and dead cells in turquoise:

https://algoristic.de/automata/30/256?a=ff00ff&d=00ffff

Rule 30 for 256 cells in 256 generations with living cells in pink and dead cells in turquoise


Rule 30 for 256 cells in 256 generations with dead cells in black and a linear interpolation from red to blue for the living cells:

https://algoristic.de/automata/30/256?a=ff0000&ai=0000ff&d=000000

Rule 30 for 256 cells in 256 generations with dead cells in black and a linear interpolation from red to blue for the living cells




📝 Documentation

⚗️ Path-Parameters

Define what automaton will be calculated.

Path Segments
${rule} ${dimensions}
${rule} ${dimensions} ${filename}.${filetype}
${rule} ${size} ${generations} ${filename}.${filetype}
${rule} ${size} ${generations} single | random | ${seed}
${rule} ${size} ${generations} single | random | ${seed} ${filename}.${filetype}

rule

rule → Decimal rule of an elementary cellular automaton

0 ≤ rule < 256

dimensions

dimensions → Shortcut to set size and generations at once

2 ≤ dimensions
and
dimensions × scale ≤ 40961

size

size → Number of cells in a generation

2 ≤ size
and
size × scale ≤ 40961

generationas

generations → Number of generations to be evolved

1 ≤ generations
and
generations × scale ≤ 40961

filename

filename → Name of the generated image file

filename has to be a valid file name

filetype

filetype → Mimetype of the generated image file

filetype ∈ [png, gif, jpg, jpeg, webp]

'single' | 'random' | seed

'single' | 'random' → Start with a single living cell or randomly scattered living cells, seeded with the current datetime

'single' is the implicit default value

seed → Start with randomly scattered living cells, seeded with the given value

seed ∈ ℕ




🎨 Query-Parameters

Change the size and appearance of the output image.

scale, k

scale, k → Scaling factor for the printed size of each cell, default 2

1 ≤ [scale, k]
and
[scale, k] × [dimensions, size, generations] ≤ 4096

alive, a

alive, a → Code for the printing color of live cells, default 0000002

00000016 ≤ [alive, a] ≤ FFFFFF16

alive-interpolate, ai

alive-interpolate, ai → Color into which the living cells are interpolated, default alive

00000016 ≤ [alive-interpolate, ai] ≤ FFFFFF16

dead, d

dead, d → Code for the printing color of dead cells, default FFFFFF2

00000016 ≤ [dead, d] ≤ FFFFFF16

dead-interpolate, di

dead-interpolate, di → Color into which the dead cells are interpolated, default dead

00000016 ≤ [dead-interpolate, di] ≤ FFFFFF16


1 Please note the default value of 2 for [scale, k]

2 Please note the absence of the # charater for the hex values of alive, a, dead and d parameters.

About

Create 2D images of elementary cellular automata using a simple GET-based API.

Topics

Resources

Stars

Watchers

Forks

Languages