mirror of
https://github.com/diemheych/PrimeFORTH
synced 2024-12-25 09:58:33 +01:00
Update README.md
List additional Prime specific words
This commit is contained in:
parent
50cdb1c660
commit
90865d6904
1 changed files with 39 additions and 0 deletions
39
README.md
39
README.md
|
@ -17,3 +17,42 @@ Note: the HP Prime must be running firmware that supports Python (actually Micro
|
|||
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.
|
||||
# Additional Words
|
||||
A number of additional words have been included in the FORTH implementation, for example, to provide access to Prime graphics capability.
|
||||
|
||||
The additional words are summarised below.
|
||||
|
||||
- acos: return arccosine of n (n)
|
||||
- asin: return arcsine of n (n)
|
||||
- atan: return the arctangent of n (n)
|
||||
- circle: draw a circle (x y radius)
|
||||
- cls: clears the text and graphics (GROB 0) screens
|
||||
- col: set the current colour
|
||||
- cos: return the cosine of n (n)
|
||||
- dump: dump contents of stack to terminal window
|
||||
- fillrect: draw a filled rectangle (x y w h)
|
||||
- getcol: return the current colour
|
||||
- getpix: return pixel colour (x y)
|
||||
- getpix2: return pixel colour (x y)
|
||||
- getpix4: return pixel colour (x y)
|
||||
- int: truncate number (eg floating point)
|
||||
- key: wait for keyboard input
|
||||
- lastkey: return last key pressed
|
||||
- line: draw a line (x1 y1 x2 y2)
|
||||
- list: display FORTH file
|
||||
- load: load FORTH file
|
||||
- pixon: turn on pixel (x y)
|
||||
- pixon2: turn on scaled pixel (x y)
|
||||
- pixon4: turn on scaled pixel (x y)
|
||||
- random: return random number between 0 and n-1 (n)
|
||||
- rect: draw a rectangle (x y w h)
|
||||
- sin: return sine of n (n)
|
||||
- sleep: sleep for n milliseconds (n)
|
||||
- sqrt: return square root of n (n)
|
||||
- tan: return tangent of n (n)
|
||||
- ticks: return the HP Prime millisecond timer
|
||||
- words: list all available words
|
||||
- sleep: pause program for a number of milliseconds (n)
|
||||
|
||||
Graphics commands use Prime pixel co-ordinates where 0,0 is the top left of the screen.
|
||||
Scaled pixel commands double or quadruple the pixel size and similarly scale x and y by the same amount (for example, Snake game uses pixon4 and getpix4).
|
||||
|
|
Loading…
Reference in a new issue