(41C) How to edit & debug complex programs?
|
04-14-2023, 08:00 PM
Post: #9
|
|||
|
|||
RE: (41C) How to edit & debug complex programs?
Editor
I write most of the programs for the HP-42S in Visual Studio Code with the HP42S-free42 extension. To run the program I copy and paste it into the Free42 simulator. Adapting the program to other models is often an easy task once it runs. Compiler I would have recommended the Python to RPN converter but the link doesn't work for me any more. My Python to FOCAL Compiler only works with Python 2.7 but you might still have that installed somewhere. This program to calculate the Perimeter of an Ellipse can be translated to Python (say in the ellipse.py file): Code: from math import sqrt, pi The compiler.py program must be adjusted a bit: Code: import dis The result is far from perfect but can be used as a starting point: Code: LBL "AGM2" You may notice a few issues:
We can easily rewrite ELLIPSE to avoid this: Code: 00 { 27-Byte Prgm } With these changes the program gives the correct result. Example 4 ENTER 3 XEQ "ELLIPSE" 22.1034921607 References |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)