Skip to content

darwins-challenge/drawing-prototype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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())));

Releases

No releases published

Packages

No packages published