Commit Graph

11 Commits

Author SHA1 Message Date
Lephe 8c3341d09f
tests: add two more entries to the 2019 contest 2019-10-26 18:35:58 +02:00
Lephe 77404fa61b
lang: realize that WHILE was actually UNTIL 2019-10-26 18:29:58 +02:00
Lephe 32fbcf143a
more atomic committing
* Proper coordinate rounding, as in Arond()
* Forgotten EOL now consumed if found (still optional)
* Convert unit tests images to 1-bit before comparing
* Much better unit testing script
* Add 17 test scripts from the 2019 TI-Planet and Planète Casio contest
  which consisted in reproducing an image with minimum code
2019-10-26 13:51:54 +02:00
Lephe f1cc4ace40
update atomically (like a bomb)
* Fix angle units for reverse trigonometric functions
* Add a streaming option to capture the output in real-time as a series
  of bitmap images
* Switch to Decimal due to the non-continuity of Ent() breaking
  assumptions about the fidelity of floats. Trigonometry functions are
  still computed as floats.
* Fix the line rendering algorithm for edge cases and add a new test
  line-positive.txt that ensures basic patterns are all correct.
* Use custom rules to generate text representation of decimal numbers as
  to better match the output of the fx-92.
* Improve the test constants.txt to better evaluate this representation.
  The interpreter automatically checks that the representation matches
  the value and fails on error to avoid scratching heads.
* Fix EQUAL not being treated as a relational symbol.
2019-10-25 13:38:10 +02:00
Lephe 907c800696
add the theta variable name 2019-10-15 11:25:39 +02:00
Lephe 14846e56ae
add functions with multiple parameters 2019-10-08 21:20:08 +02:00
Lephe afb0511ea0
allow more flexible constant specifications 2019-10-06 11:51:02 +02:00
Lephe 9bf03c52be
allow <sign><function> atoms 2019-10-06 10:57:58 +02:00
Lephe 7db38aac06
add basic unit tests
Windows can't be hidden yet because texture rendering seems to fail in
this case. This will have to be investigated later.
2019-10-06 02:08:58 +02:00
Lephe 2c7287338c
use proper line rendering
There are some edge cases to Bresenham's line drawing algorithm with
cumul=dx. The fx-92 SC+ clearly checks cumul>dx, but for dx=1 and dy=1
this results in a horizontal line.

Apparently dx=dy is the only case where the fx-92 SC+ behaves
differently than cumul>dx, as seen with dx=5 dy=4 (causes cumul=dx after
2 iterations but does not trigger the condition).

Also allow the program to be interrupted with Escape while paused.
2019-10-06 00:06:04 +02:00
Lephe 3d8dcdd989
add command-line options and a text lexer
This change lays the ground for automated unit tests. It adds
command-line options to select the input language format between URL
(hexa text) and plain text, change a few output settings, and redirect
graphical output to an image.

A text lexer has also been added so that unit tests and new programs can
be written in an English-like syntax instead of raw hexadecimal.
2019-10-02 07:18:29 +02:00