An fx-92 Scientifique Collège+ algorithmic interpreter for PC.
Go to file
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
doc update atomically (like a bomb) 2019-10-25 13:38:10 +02:00
fx92 update atomically (like a bomb) 2019-10-25 13:38:10 +02:00
tests update atomically (like a bomb) 2019-10-25 13:38:10 +02:00
.gitignore initial commit: most of the lexing and parsing work 2019-09-30 11:29:05 +02:00
README.md add a README file 2019-10-09 07:09:35 +02:00
fx92.py update atomically (like a bomb) 2019-10-25 13:38:10 +02:00
tests.py allow <sign><function> atoms 2019-10-06 10:57:58 +02:00

README.md

Python-based fx-92 Scientifique Collège+ interpreter

This is an alternate imlementation of the fx-92 SC+ Algorithmic application. It interprets programs read from QR code URLs or text files, and renders images using the SDL.

Requirements:

  • Python ≥ 3.5 (may work with older versions)
  • PySDL2 (pip3 install --user PySDL2)

Running programs

To run programs, execute fx92.py and specify an input file:

./fx92.py [-s|-u] <input file> [options...]
  • If the input file contains text instructions (for example goto 12,35), specify -s (this is the default).
  • If the input file contains a QR code URL (for example https://...F908313200333500), specify -u.

The input can also be set to -, in which case the interpreter reads from standard input. Typical use case is for URLs:

echo -n "F908313200333500" | ./fx92.py -u -

Output options

  • --scale <n> lets you set the (integer) scaling ratio of the output.
  • --save <bmp> will save a screenshot of the output to the designated file.
  • --quiet will "hide" the window while executing. (At the moment the window is still shown, but closed immediately, due to SDL subtleties.)

Tests

A few units tests are provided. Run tests.py to execute them.