Post Reply 
(41C) Pythagorean Triples
07-03-2022, 01:55 PM
Post: #10
RE: (41C) Pythagorean Triples
(07-03-2022 08:18 AM)C.Ret Wrote:  PYT:
« 1 +
 [[ 1 2 2 ][ 2 1 2 ][ 2 2 3]] → T n M
 «
   " " 1 n 2 * SUB T →STR + PR1 STR→
   IF n N <
   THEN
      M T 2 DUP2 GET NEG PUT * n PYT
      M T             * n PYT
      M T 1 DUP2 GET NEG PUT * n PYT
   END » »

Store max depth into N register:
4 'N' STO

Set printer online, aim to it and print by typing:
[ 3 4 5 ] 0 PYT

That's a great program! I'm glad you posted it before I posted my sad attempt. Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(41C) Pythagorean Triples - SlideRule - 10-15-2019, 12:57 PM
RE: (41C) Pythagorean Triples - C.Ret - 06-26-2022, 09:29 AM
RE: (41C) Pythagorean Triples - John Keith - 07-01-2022, 11:55 AM
RE: (41C) Pythagorean Triples - C.Ret - 07-03-2022, 08:18 AM
RE: (41C) Pythagorean Triples - John Keith - 07-03-2022 01:55 PM
RE: (41C) Pythagorean Triples - C.Ret - 07-03-2022, 01:41 PM



User(s) browsing this thread: 1 Guest(s)