digital literacy for everyone


[lit]

[generate-title]

[lit] fig is a multi-purpose educational language-- originally designed to offer 16 colours in the term window or vt, with a compatible 16-colour palette in a graphics window. in 2017, i decided that rather than extend the language, a simple function (rgbcolour) would allow 24-bit colour without any change to the language itself. gem seven is one of the early programs that use this function. [img]https://ia801509.us.archive.org/29/items/fig_screencaps/gemseven.fig.png[img] [fig] #### license: creative commons cc0 1.0 (public domain) #### http://creativecommons.org/publicdomain/zero/1.0/ proginf = "gem seven 2017 mn" function rgbcolour r g b c python figcgapal[c] = (r, g, b) fig fig v 1 c 400 w 3.14159 divby 2 xb yb for r 490 300 -.25 e w minus 0.00413367105263 swap e w # 3.14159 / 4 / (490 - 300) for p 0 3.14159 0.44879857142857144 # 3.14159 / 7 e w cos times 380 divby 2 int rc r divby 3 plus 40 int rd 256 minus rc rgbcolour rd rc 0 11 x p times 2 cos times e plus c int y p times 2 sin times e plus r minus 50 int m 6.28 plus 1.57 divby 108.503 divby 2 now v plus m swap now v rc r divby 4 int mod 2 iftrue rc iftrue xb now v int mod 2 times 11 line xb yb x y now else now v int mod 2 times 11 pset x y now fig xb x yb y fig next now display next now display lineinput
fig main page: [url]https://codeinfig.neocities.org/fig/index.html[url] home: [lit]https://codeinfig.neocities.org[lit]