diff options
Diffstat (limited to 'prog')
-rw-r--r-- | prog/euclideanAlgorithm.doml | 66 | ||||
-rw-r--r-- | prog/simpleWhileLoop.doml | 38 |
2 files changed, 104 insertions, 0 deletions
diff --git a/prog/euclideanAlgorithm.doml b/prog/euclideanAlgorithm.doml new file mode 100644 index 0000000..87fa168 --- /dev/null +++ b/prog/euclideanAlgorithm.doml @@ -0,0 +1,66 @@ +<!-- vim: set filetype=html: --> +<!doctype html> +<html> + <head> + <script type="text/javascript" src="../lib/util.js"></script> + <script type="text/javascript" src="../lib/types.js"></script> + <script type="text/javascript" src="../lib/binops.js"></script> + <script type="text/javascript" src="../lib/statements.js"></script> + <script type="text/javascript" src="../lib/readability.js"></script> + <script type="text/javascript" src="../lib/run.js"></script> + <link rel="stylesheet" href="../lib/style.css"> + </head> + <body> + <span class="statement-sequence"> + <span class="assign" data-name="a"> + <span class="constant" data-val="2250256" data-type="number"></span> + </span> + + <span class="assign" data-name="b"> + <span class="constant" data-val="8273" data-type="number"></span> + </span> + + <span class="while"> + <span class="compare" data-op="!="> + <span class="variable" data-name="b"></span> + <span class="constant" data-val="0" data-type="number"></span> + </span> + + <span class="branch"> + <span class="compare" data-op=">"> + <span class="variable" data-name="a"></span> + <span class="variable" data-name="b"></span> + </span> + + <span class="assign" data-name="a"> + <span class="bin-op" data-op="-"> + <span class="variable" data-name="a"></span> + <span class="variable" data-name="b"></span> + </span> + </span> + + <span class="assign" data-name="b"> + <span class="bin-op" data-op="-"> + <span class="variable" data-name="b"></span> + <span class="variable" data-name="a"></span> + </span> + </span> + </span> + </span> + + <span class="branch"> + <span class="compare" data-op="=="> + <span class="variable" data-name="a"></span> + <span class="constant" data-val="1" data-type="number"></span> + </span> + <span class="print"> + <span class="constant" data-val="Relatively prime" data-type="string"></span> + </span> + <span class="print"> + <span class="constant" data-val="Found GCD" data-type="string"></span> + <span class="variable" data-name="a"></span> + </span> + </span> + </span> + </body> +</html> diff --git a/prog/simpleWhileLoop.doml b/prog/simpleWhileLoop.doml new file mode 100644 index 0000000..ab458e6 --- /dev/null +++ b/prog/simpleWhileLoop.doml @@ -0,0 +1,38 @@ +<!-- vim: set filetype=html: --> +<!doctype html> +<html> + <head> + <script type="text/javascript" src="../lib/util.js"></script> + <script type="text/javascript" src="../lib/types.js"></script> + <script type="text/javascript" src="../lib/binops.js"></script> + <script type="text/javascript" src="../lib/statements.js"></script> + <script type="text/javascript" src="../lib/readability.js"></script> + <script type="text/javascript" src="../lib/run.js"></script> + <link rel="stylesheet" href="../lib/style.css"> + </head> + <body> + <span class="statement-sequence"> + <span class="assign" data-name="x"> + <span class="constant" data-val="0" data-type="number"></span> + </span> + + <span class="while"> + <span class="compare" data-op="<"> + <span class="variable" data-name="x"></span> + <span class="constant" data-val="100" data-type="number"></span> + </span> + + <span class="assign" data-name="x"> + <span class="bin-op" data-op="+"> + <span class="variable" data-name="x"></span> + <span class="constant" data-val="1" data-type="number"></span> + </span> + </span> + </span> + + <span class="return"> + <span class="variable" data-name="x"></span> + </span> + </span> + </body> +</html> |