darwins-challenge / drawing-prototype

A prototype to explore genetic programming of drawings.

Home Page:http://darwins-challenge.github.io/drawing-prototype/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drawing Prototype

A prototype to explore genetic programming of drawings.

Language

Syntax

We are going to use the following language to describe our drawings.

program  = 'program(' sequence ');'
sequence = 'sequence()' | 'sequence(' action (',' action)* ')'
action   = turn
         | step
         | sequence
turn     = 'left()'
         | 'right()'
step     = 'forward()'

Semantics

The following machine will execute our programs. It maintains a directions which can be one of north, east, south or west. The direction is initialized to be north.

The machine will perform the following actions:

  • left(): change direction counter clockwise along the compass.
  • right(): change direction clockwise along the compass.
  • forward(): take a step in direction leaving a trail.
  • sequence: perform the actions in sequence.

Examples

The following programs are all valid.

  • program(sequence());
  • program(sequence(forward()));
  • program(sequence(forward(),left(),forward(),left(),forward(),left(),forward(),left()));
  • program(sequence(sequence(forward(),left(),forward()),sequence(forward(),right(),forward())));

About

A prototype to explore genetic programming of drawings.

http://darwins-challenge.github.io/drawing-prototype/

License:MIT License


Languages

Language:JavaScript 100.0%