(49g 50g) Fast Pascal's triangle and its relatives
|
03-02-2019, 07:12 PM
Post: #7
|
|||
|
|||
RE: (49g 50g) Fast Pascal's triangle and its relatives
(08-20-2018 12:43 AM)Joe Horn Wrote: Smaller but a tad slower (just thinking of alternative methods for fun): Similar idea without using LASTARG: Code: \<< 0 OVER + SWAP 0 + ADD \>> BTW: Both variants work with { 1 } while John Keith's solutions starts working with { 1 1 }. However they can't use the symmetry and do only half of the work when Pascal's triangle is generated. Instead we'd have to use two programs say ODD and EVEN that we call alternatively. ODD Code: \<< 0 OVER + REVLIST TAIL REVLIST ADD \>> EVEN Code: \<< 0 OVER + SWAP DUP REVLIST HEAD + ADD \>> Examples: { 1 } ODD { 1 } EVEN { 1 2 } ODD { 1 3 } EVEN { 1 4 6 } ODD { 1 5 10 } EVEN { 1 6 15 20 } ODD { 1 7 21 35 } … Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(49g 50g) Fast Pascal's triangle and its relatives - John Keith - 08-11-2018, 04:58 PM
RE: (49g 50g) Fast Pascal's triangle and its relatives - Joe Horn - 08-12-2018, 12:41 AM
RE: (49g 50g) Fast Pascal's triangle and its relatives - John Keith - 08-12-2018, 02:12 PM
RE: (49g 50g) Fast Pascal's triangle and its relatives - John Keith - 08-19-2018, 02:14 PM
RE: (49g 50g) Fast Pascal's triangle and its relatives - Joe Horn - 08-20-2018, 12:43 AM
RE: (49g 50g) Fast Pascal's triangle and its relatives - John Keith - 08-20-2018, 12:15 PM
RE: (49g 50g) Fast Pascal's triangle and its relatives - Thomas Klemm - 03-02-2019 07:12 PM
RE: (49g 50g) Fast Pascal's triangle and its relatives - John Keith - 01-28-2020, 06:12 PM
RE: (49g 50g) Fast Pascal's triangle and its relatives - John Keith - 12-15-2021, 07:31 PM
|
User(s) browsing this thread: 1 Guest(s)