free software resistance

 the cost of computing freedom is eternal vigilance

### fig1 *original date:* dec 2015 *originally posted:* sep 2024 one of my efforts to track and document version changes in fig: ``` fig 0.4 * feb 05 2015 * **could be first version of fig**, renamed from 0.3 of its predecessor * **last version that does the following:** * main variable starting line *only zeroes on first use* * for loops have no step parameter (changes in 0.5) 0.5 * feb 07 2015 * "main variable" is zeroed on each use: (arrays will be the exception) * ^ otherwise you have to 0 *or* keep conscious track of every global used * `for` loops are 4 instead of 3-parameter: *var, start, stop, step* * added `topwr`, `mod`, `cos`, `sin`, `sqr` 0.6 * feb 09 2015 * added `system`, `swap`, `time`, `timer`, `hex`, `oct`, `rtrim`, `string`, `tan`, `val` * note that `string` (modeled after the basic command) should be count * str * (string command implemented with wrong param order, fixed in 1.5 / apr 2015) * also note that fig has more reliable string multiplication: `times` 0.7 * feb 10 2015 * implemented `str` command (went unnoticed as placeholder with no effect from 0.4) * features: `lcase`, `end`, `try`/`except`/`resume` * gfx stuff defaults to textmode on vt (even without user calling `textmode` command) 0.8 * feb 14 2015 * **optional** command / param separator `,` changed to `:` for basic users * (`,` will come back in 2.2 when both + several more are allowed) * pygame is now optional ; runs gfx in textmode even if pygame is not installed * no more deps (colorama is still needed for windows users unless they run ansi.sys) == original requirements / goals == * 1. input (keyboard at least) * 2. output (text, graphics, files) * 3. basic math * 4. variables * 5. routines (functions) * 6. conditionals * 7. loops * 8. iteration (doing things with lists, files) > "i would rather inspire people to create their own language than to use a language that doesn't suit their needs. the more languages people write, the better the odds that one will be wonderful to use for many people." == i think there will be a "fig leaf basic" but it will be more like logo == > and now i have an idea for a closer-to-basic dialect with terse syntax which i'll call "fig basic." * jan 25 2015 > "fig basic" is not as descriptive as what i wanted to call it: "pipeline" or "toy blocks." but fig basic is based on the idea of toy blocks. i didn't want to say stacking, because then people will think of things like forth. > note this is NOT a deliberately obtuse stack-based basic. it's based on the idea of a pipeline. > there are no optional parameters. locate ALWAYS is row column: > locate y x > if you want just row 5, you can have a row statement. > but if you want x = "-5" : x = abs(int(val(x))) > it will look like this: x "-5" val int abs > there are two ways to do parameters: we can try to invent ONLY statements with zero or one parameters... OR, > we can try to keep the number down as far as possible. generally to 3 or less. > but they're always fixed. it's much less confusing that way. y mid x 5 1 #### y = mid(x, 5, 1) x left x 7 #### x = left(x, 7) 0.9 * feb 16 2015 * added `ltrim`, `lineinput`, `len`, `asc`, `atn` 1.0 * feb 19 2015 * now has arrays: `p : arr : times 100 # dim p (0 to 99)` * no way to change an existing element yet, although you can add them: p : 7 : print arr ## dim p(1) : p(1) = 7 p : plus 5 : plus 3 : print ## redim _preserve p(3) : p(2) = 5 : p(3) = 3 z p : mid 2 1 : print ## z = p(2) : print z * variables that start a line are zeroed unless they are arrays 1.1 * feb 21 2015 * set an array element using `arrset index value` * current variable can be set to output of `join arrayname string` 1.2 * feb 24 2015 * `else` added * `arrget` added (no need to copy entire array and use mid-- which still works) * `split` added * `arropen` added (read a file to an array without using inline python feature) 1.3 * mar 01 2015 * debug info in divby removed * backwards loops working as intended for first time * `forin`/`nextin` (array-processing for loops) * `ifequal` 1.4 (it says 0.14) * mar 05 2015 * `line` * `not` (converts zero to nonzero, or nonzero to zero) * `arrget` range fixed (begins at 1) * `sgn` * `for` loops support floating step, if step is constant * (1.1 -1.0 -0.10 etc) 1.5 * apr 02 2015 * fixed `string` command, fig had it backwards * in basic it is string(count, string) or string(count, ascii) * should now load files with windows or gnu/linux cr/lf vs. lf, even cr-only * (affects `arropen` and new `arrcurl` command) * `arrcurl` command gets a url. works like `arropen` except for urls * `arrsort` command * `arreverse` command (two rs. could have done 3, but didnt) 1.6 * apr 04 2015 * translator now uses crlf/cr/lf processing that arropen/arrcurl use * `instr stringtosearch stringtolookfor` * `chdir` * `shell` * `arrshell` * `instr` works on strings and arrays * `chdir` changes cwd to main variable ; aborts program if unsuccessful 1.7 * may 02 2015 * improved prints command; updates properly * date (was going to mm/dd/yy like qb, chose mm/dd/yyyy) * arreverse probably faster but: reverse added; does strings+arrays * arrstdin added: array from stdin (forin p stdin works too) * display added: qb64-style graphics screen updates * (without display command, pset just draws a dot and updates. like in qb64, after first time display is issued, graphics commands no longer update except when you call display) 1.8 * may 16 2015 * added ifmore command * added ifless command * improved some parsing of #comments * changed <> to != for python3ness (not compatible with python3) 1.9 * jun 01 2015 * increased support for printing unicode strings 2.0 * jul 01 2015 * open "w": opens current string (containing pathname) for writing * fprint somepathstring: if open, prints to somepathstring * (adds crlf to line for windows, otherwise lf) * close pathstring (containing pathname) * there are no file handles in fig; internally, file handles are stored in a hash table * this means you can only open each file (one mode at a time) once per running script, until it is closed * this is not systemwide, it is per running script * you can open more than one file at a time, as long as theyre different files 2.1 * jul 09 2015 * open, close, fprint commands now have proper internal ids * (this makes fig behave more consistently; existing programs should still work) * flineinput "filepath" implemented * flineinput all you like will not return chr(10) until it reaches eof * if you want an easier way to read files, use arropen * cls finally implemented fig 2.9: (python2, cc0, public domain) http://pastebin.com/F6kBzRxd (cheat sheet) ``` license: 0-clause bsd ``` # 2015 mn # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ``` => https://freesoftwareresistance.neocities.org