RosettaCodeData/Task/Metallic-ratios/Quackery/metallic-ratios.quackery

44 lines
901 B
Plaintext

[ $ "bigrat.qky" loadfile ] now!
[ [ table
$ "Platinum" $ "Golden"
$ "Silver" $ "Bronze"
$ "Copper" $ "Nickel"
$ "Aluminium" $ "Iron"
$ "Tin" $ "Lead" ]
do echo$ ] is echoname ( n --> )
[ temp put
' [ 1 1 ]
13 times
[ dup -1 peek
temp share *
over -2 peek +
join ]
temp release ] is task1 ( n --> [ )
[ temp put
' [ 0 1 1 ]
[ dup -3 split nip
do dip tuck swap
32 approx= if done
dup -1 peek
temp share *
over -2 peek +
join
again ]
temp release
dup size 3 - swap
-3 split nip
-1 split drop
do swap rot ] is task2 ( n --> n/d n )
10 times
[ i^ echoname cr
i^ task1
witheach [ echo sp ] cr
i^ task2
echo sp
32 point$ echo$
cr cr ]