Python to FOCAL Compiler
|
10-06-2015, 08:19 PM
(This post was last modified: 10-07-2015 01:41 AM by Gerson W. Barbosa.)
Post: #8
|
|||
|
|||
RE: Python to FOCAL Compiler
(10-06-2015 07:11 PM)Thomas Klemm Wrote: [quote='Gerson W. Barbosa' pid='43596' dateline='1444147083'] Here's a Python program based on Hugh's implementation: Code: def ellipse(a, b): And that's the generated FOCAL program using 113 bytes: Code: LBL "ELLIPSE" But we can easily bring this down to 77 bytes: Code: LBL "ELLIPSE" Thank you very much for the HP-41 programs! As a compensation for my laziness, here is a 163-byte RPL stack-only version of the Pascal program, if you don't mind the off-topic content: Code:
RPL masters might shorten this a bit and do more elegant stack manipulations. It's not an exact implementation of Hugh's algorithm because there is no break from RPL structures. Best regards, Gerson . P.S.: Just tested your second program on my HP-41CV (because it's shorter). Very fast! (less than 5 seconds!). Thanks again! Edited to add a missing s lest I am given a free grammar lesson :-) |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Python to FOCAL Compiler - Thomas Klemm - 10-05-2015, 10:58 PM
RE: Python to FOCAL Compiler - Sukiari - 10-06-2015, 03:36 AM
RE: Python to FOCAL Compiler - Massimo Gnerucci - 10-06-2015, 05:50 AM
RE: Python to FOCAL Compiler - Ángel Martin - 10-06-2015, 11:16 AM
RE: Python to FOCAL Compiler - Gerson W. Barbosa - 10-06-2015, 03:58 PM
RE: Python to FOCAL Compiler - Thomas Klemm - 10-06-2015, 07:11 PM
RE: Python to FOCAL Compiler - Gerson W. Barbosa - 10-06-2015 08:19 PM
RE: Python to FOCAL Compiler - Thomas Klemm - 10-06-2015, 07:55 PM
RE: Python to FOCAL Compiler - Thomas Klemm - 10-06-2015, 08:28 PM
RE: Python to FOCAL Compiler - Gerson W. Barbosa - 10-07-2015, 01:47 AM
RE: Python to FOCAL Compiler - Thomas Klemm - 10-07-2015, 04:34 AM
RE: Python to FOCAL Compiler - Massimo Gnerucci - 10-07-2015, 05:38 AM
Java to FOCAL Compiler - Thomas Klemm - 10-07-2015, 04:38 PM
|
User(s) browsing this thread: 2 Guest(s)