free software resistance
the cost of computing freedom is eternal vigilance
### card
*original date:* dec 2020
*originally posted:* oct 2024
card:
```
HOW CARD IS DRAWN...
THIS CODE DRAWS AN OVAL
...it iterates from -pi to pi and by dividing the y coordinates by 5,
...makes horizontal oval instead of circle.
function oval w h s c
for p -3.14159 3.14159 .001
wp = p cos times s plus w int
hp = p sin times s divby 5 plus h int
now ; pset wp hp c
next
next
THIS CODE DRAWS HALF A CIRCLE
...it is only used to draw ornaments. ornaments are stacked ovals, but
...to stack them into spheroids you need to know what length to make
...each oval. this draws a half circle, or rather it calculates the
...farthest (rightmost) coordinate from the centre for each "height"
...of the part of the spheroid beind drawn. thats what "return count"
...does-- it returns a value used to figure out the size of each oval.
function scirc s l
count = 0
w = 1
h = s divby 2 plus 1
for p -1.57079 1.57079 .03
wp = p cos times s plus w int
hp = p sin times s divby 2 plus h int
ifequal hp l
ifmore wp count
count = wp
next
next
next
now return count
next
THIS CODE DRAWS AN ORNAMENT
...you give it location coordinates, then size, then two colour values.
...it loops through the size (the height) aur draws ovals one on top of
...the other. it gets size information based on curve plotted by SCIRC.
function spheroid w h s c o
for each s 0 -2
l = scirc s each print
hp = h plus each
now ; oval w hp l c swap c o
next
next
THIS CHANGES THE UGLY YELLOW ANSI COLOUR TO BROWN
python
figcgapal[6] = (85,45,0)
fig
now ; highlight 7 ; cls <- WHITE BACKGROUND CLEAR SCREEN
STEP THROUGH FROM 450 (lower part of screen) TO 370 (higher)
...this draws the trunk of the tree by drawing a brown oval,
...then moving up 2 pixels, then drawing another, repeatedly.
for each 450 370 -2
now ; oval 500 each 32 6
next
tree = 2 <- GREEN
alt = 10 <- LIGHT GREEN
circ = 200 <- START OVAL SIZE
count = 0 <- COUNTER
DRAW THE TREE
...draw a big green oval, move up a pixel...
...decrease size a little, draw another, repeat.
...keep a count of ovals, if it reaches 25 then
...increase the size a bit again, switch colour
...from green/light green or light green/green
...stop repeating at y coord 120 (closer to top)
for each 370 120 -1
now = circ minus 1.4 swap now circ
now = count plus 1 swap now count
ifmore count 25
now ; circ plus 17 swap now circ
count = 0
now ; swap tree alt
next
now ; oval 500 each circ tree
next
DRAW ORNAMENTS
...each call to spheroid draws one
now spheroid 355 336 33 12 4
now spheroid 521 245 33 1 9
now spheroid 620 302 33 12 4
now spheroid 485 291 33 1 9
now spheroid 425 235 33 12 4
now spheroid 415 314 33 1 9
now spheroid 488 175 33 12 4
now spheroid 581 357 33 1 9
now spheroid 464 346 33 12 4
now ; locate 1 1 <- MOVE TO TOP LEFT OF SCREEN AFTER DRAWING
```
license: 0-clause bsd
```
# 2020 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