Use the HP Connectivity Kit to transfer FORTH.hpprgm to a virtual or physical HP Prime calculator.
Note: the HP Prime must be running firmware that supports Python (actually MicroPython).
# Source
FORTH.py includes the source code and the PPL wrapper for execution on the HP Prime. The source can be loaded into the HP Connectivity Kit, modified if required, and dragged onto a virtual or physical HP Prime calculator.
# Examples
To use the example FORTH files (or your own FORTH in a text file with .fth extension), add the files to the Python environment of the HP Prime calculator. In the HP Connectivity Kit, browse to the appropriate calculator, Application Library, Python and Files to see the files already loaded into Python. Right click on Files and select Add File and browse to the text file with .fth extension. Click save and the FORTH file can now be accessed from Prime FORTH with 'list' to view the contents or 'load' to load the file.
Graphics commands use Prime pixel co-ordinates where 0,0 is the top left of the screen and 319,239 is the bottom right (total screen size is 320x240).
Scaled pixel commands double or quadruple the pixel size and similarly scale x and y down by the same amount for virtual screen sizes of 160x120 and 80x60 (for example, Snake game uses pixon4 and getpix4 so the snake and apple are larger and easier to see).
Keycodes for key and lastkey are detailed at: https://en.hpprime.club/docs/reference/GETKEY
# References
FORTH Prime is based on: https://www.openbookproject.net/py4fun/forth/forth.html
Snake game is based on: https://skilldrick.github.io/easyforth/#snake