This is a compiler for a language that provide a python-like interface to draw figures.
- use
cargo run
to compile and use it. - when program launch, you can see an interface like
>>>
If you enjoy writing code in file, it would be better for you to write the code in a file that has a suffix .pg
, and
use is as input:
$> penguin-lang file.pg
- origin is (<num>, <num>);
- rot is <num>;
- scale is (<num>, <num>);
- set x (<num>, <num>);
- set y (<num>, <num>);
- set color <color>;
- set size n;
- for t from <num> to <num> step <num> draw(<expr of t>, <expr of t>);
- show;
- exit/quit/q
- rot = 0
- origin = (0, 0)
- scale = (1, 1)
- color = yellow
- x = (0, 10)
- y = (-4, 4)
- size = 2
- output -> /graph (unchangeable now)
- blue
- red
- green
- black
- yellow
- cyan
- magenta
- cos
- sin
- tan
- ln
- exp
- sqrt
A proper example can be found in root directory: code.pg
.
Enjoy it! :)