Skip to content

Instantly share code, notes, and snippets.

@brudil
Created November 12, 2017 14:43
Show Gist options
  • Select an option

  • Save brudil/4f6dde4632c7b4ec4470a22e752adfb4 to your computer and use it in GitHub Desktop.

Select an option

Save brudil/4f6dde4632c7b4ec4470a22e752adfb4 to your computer and use it in GitHub Desktop.

How to draw

Our rend language consists of:

  • variable declarations
  • loop settings
  • statements

Variable declarations

Variables are single characters. They are defined as x=(expressions). Multiple varibles can be defined with a comma seperating them.

x=100,y=0;

loop settings

Next you define how often you want to paint. 300ms:

Statements

Statements end with a semicolon.

color

Set the paint color with #websafecolor, for example #orange;

rectangle

Use the r method for drawing rectangles.

r x y w h where x y w h are expressions.

line

Use the l method for drawing rectangles.

r ax ay bx by where ax ay bx by are expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment