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. sines is one of the earliest programs that use this function. [img]https://ia801509.us.archive.org/29/items/fig_screencaps/sines.fig.png[img] [fig] #### license: creative commons cc0 1.0 (public domain) #### http://creativecommons.org/publicdomain/zero/1.0/ proginf = "sines-2017 mn" function rgbcolor r g b python now = 0 ; figcgapal[0] = (r, g, b) fig fig function rgbvalue v python # this probably doesnt do what it should # but it does let you send an integer for a color b=(v/65536 - 1) % 256 g=((v - b * 65536) / 256 - 1) % 64 r=((v - b * 65536 - g * 256) - 1) % 256 now = 0 ; figcgapal[0] = (int(r), int(g), int(b)) fig fig FOR z = 1 190 0.125 # 1.0 / 2 ** 3 now display FOR x = -3.14 3.14 0.0078125 # 1.0 / 2 ** 7 f = f + 0.0000002384185791015625 # 1 / 2 ** 22 f1 = f plus 1 y2 = (x times 8) SIN times 10 y = z divby 4 times x divby 1.5 SIN times 10 plus y2 x2 = x times 100 xl = z times 8 SIN plus z plus x2 plus 325 divby 10 times 9 int yl = y plus 25 plus z divby f1 y2 = yl plus 2 int for yt yl y2 1 c = z divby 2 times 32768 int mod 10000 plus 200 rgbvalue c now pset xl yt 0 next NEXT NEXT now display lineinput
fig main page: [url]https://codeinfig.neocities.org/fig/index.html[url] home: [lit]https://codeinfig.neocities.org[lit]