Commit Graph

13 Commits

Author SHA1 Message Date
Lephe 8d8707f3a9
keyseq: start a feature to print input sequence 2022-01-15 11:48:10 +01: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 9bf03c52be
allow <sign><function> atoms 2019-10-06 10:57:58 +02:00
Lephe 69b5b52fdd
structural update: move files to a subfolder
Also update the documentation of supported tokens and features for more
clarity.
2019-10-06 01:34:42 +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
Pavel Demin 3f5db406eb improve compatibility with older python 3 versions 2019-10-05 11:26:43 +02:00
Lephe a983faedeb
add relations, and most functions
This change adds a [cond] grammar symbol corresponding to binary
relations in IF, IFELSE and WHILE conditions. It also adds support for
unary functions with parenthesis syntax. Other functions will need
specific rules depending on their operator precedence level.

Also adds the Window.save() function that implements the --save option
to save the output of the program into a bitmap file. This will be used
to perform automated unit tests.
2019-10-04 12:44:27 +02:00
Lephe 0e9a2ee944
use true window size 2019-10-02 07:56:58 +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
Lephe cd2936c582
add a first interpreter
Note that there are still bugs and the output is really not what it
should be. Will fix that with unit tests ASAP.
2019-10-01 18:05:22 +02:00
Lephe 8269ab3f19
add SDL2 rendering with a simple test 2019-10-01 13:40:52 +02:00
Lephe f08f613a17
improvements on AST shape and printing 2019-10-01 07:04:02 +02:00
Lephe 6151144d0a
initial commit: most of the lexing and parsing work
The program is currently able to lex most useful tokens, and parse
constructs associated with them on simple examples.

Unit tests are still missing to formally ensure everything's right.
2019-09-30 11:29:05 +02:00