diff options
| author | Tom Harley | 2019-12-23 01:32:39 +0000 |
|---|---|---|
| committer | Tom Harley | 2019-12-23 01:32:39 +0000 |
| commit | 7bc67b95161a34f8eca635d4000d9602508a9243 (patch) | |
| tree | 585b3778dc1967832390e5829e4b3909b4184a2c /examples/power.int | |
| parent | Add basics for interpreter; add CLI options (diff) | |
| download | sinter-7bc67b95161a34f8eca635d4000d9602508a9243.tar.gz sinter-7bc67b95161a34f8eca635d4000d9602508a9243.zip | |
checkpoint
Diffstat (limited to 'examples/power.int')
| -rw-r--r-- | examples/power.int | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/power.int b/examples/power.int new file mode 100644 index 0000000..119166d --- /dev/null +++ b/examples/power.int @@ -0,0 +1,18 @@ +[def -- [x] + [- x 1]] + +[def +++ [x y] + [+ x y]] + +[def *** [x y] + [if x + [+++ y [*** [-- x] y]] + 0]] + +[def ^^^ [b p] + [if p + [*** b [^^^ b [-- p]]] + 1]] + +[def inter_main [] + [debug_int [^^^ 3 6]]] |
