gem seven (fig graphics)



#### license: creative commons cc0 1.0 (public domain)
proginf = "gem seven 2017 mn"
function rgbcolour r g b c
    figcgapal[c] = (r, g, b)
v 1
c 400
w 3.14159 divby 2
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 
                now v int mod 2 times 11 pset x y now
            xb x
            yb y
    now display
now display lineinput




13 thoughts on “gem seven (fig graphics)

      1. Yes, that is fab, i just prefer them to last a little longer. Forgive me, I know very little, just what I’ve happened to come across here and there. Today I’ve been googling moving/dancing geometric patterns as they really en-trance and relax me.

        Liked by 1 person

        1. you ought to see how long it takes to draw before i capture it and restrict the number of frames so it can fit on gfycat.

          you can make all kinds of moving geometric patterns. this one simulates graphics using text, and it keeps going– you can slow it down to any speed if you have the program i make it with

          i code these in “fig” and it requires python (a free/open source programming language ubiquitous on non-windows machines, though it is available for windows) and the non-text graphics (like the gem seven one and first animation) require pygame, which is also free/open. if you learn how to use those you can even change the colors and speed.

          Liked by 1 person

            1. no time like the present.

              heres what stops people– first of all, they make it more complicated than it is. i mean most modern coding does. i grew up with basic and it was easy to learn, even as a kid.

              second, they feel they have to learn it all at once, so they get overwhelmed. back in the 80s a lot of us were thrilled to learn one or two things a day/week. then we would have fun with that thing.

              for example, we were happy to learn “hello, world!” its just a program that puts hello, world! on the screen. in basic it looked like this:

              10 print “hello, world!”

              in qb, it looked like this:

              print “hello, world!”

              thats easy enough.

              change the color?

              color 5 : print “hello, world!”

              thats in magenta.

              color 1: print “hello, world!”
              color 2: print “hello, world!”
              color 3: print “hello, world!”
              color 4: print “hello, world!”
              color 5: print “hello, world!”

              thats blue, then green, cyan, red, magenta.

              and then each new thing that you learn is fun– like how you can use variables to hold data:

              blue = 1
              green = 2
              cyan = 3
              red = 4
              magenta = 5
              color blue : print “hello, world!”
              color green : print “hello, world!”
              color cyan : print “hello, world!”
              color red : print “hello, world!”
              color magenta : print “hello, world!”

              of course you could call those blu, grn, cyn, red, mag if you preferred.

              and for fig, that program is almost the same except print comes after the hello world part:

              now colortext blue : “hello, world!” print
              now colortext green : “hello, world!” print
              now colortext cyan : “hello, world!” print
              now colortext red : “hello, world!” print
              now colortext magenta : “hello, world!” print

              now thats a bunch, but already youve got almost enough to make a pattern that scrolls over the screen repeatedly:

              “prints” instead of print: stays on the same line.

              “sleep .1” waits for 1/10 of a second before moving to the next line of code


              put those at the top and bottom of your code and it will keep running until you hit ctrl-c or close the code window.

              if you have a mac its even easier to get started. but if you want something easier to start off with:


              thats a completely different system. i think coding in fig is better in some ways, for many things. but for what you want, moving graphics, this is easier to install.

              youd love python turtle. and you can turn the turtle cursor off and have it just draw the lines. if you install it, i can walk you through using it.

              something to consider.

              Liked by 1 person

              1. Omg thats so cool and kind of you to take the time to talk me through that, and Yes, haha! I would absolutely feel that I have to absolutely understand the in’ s and out’s of it all before commencing- which would in turn overwhelm me massively and I would give up and add to my list of failures! Ha! Apologies for the ridiculously long sentence back there. Thank you again. I will try this šŸ˜Š

                Liked by 1 person

                1. so heres what we do. first you ask yourself if its really interesting and something youd like to know.

                  then, we break it into the smallest possible steps, and just chat about it, like we are doing here.

                  at first it will feel very theoretical. since there is no timeframe, no limits on the time it takes to talk about something, we just take it all one thing at a time.

                  if one thing doesnt work, we talk about something related.

                  the system i came up with is based on 7 concepts. heres two:

                  1. you can take a piece of information, like a name or phone number, and give it a name. thats all there is to it. thats called a variable, and until you know why you just have to trust that its a powerful concept.

                  username = “animal lover”

                  2. you can put some of these instructions in a loop. what does that do? it makes it run more than once.

                  username = “animal lover”

                  now its perfectly useless to set the variable *username* to “animal lover” over and over.

                  but thats ok. because you can do it anyway, and then you understand 2 out of 7 (almost 29%) of the overall concepts of fig programming.

                  if it takes you a week or two to get that, its still 29% of the concepts involved.

                  the secret is that its that powerful. with very little effort you can make a program that asks questions and responds to answers:

                  getname “what is your name?” print lineinput colortext 14

                  now = “hello, ” prints

                  now = getname print

                  so that says:

                  what is your name?

                  and then you type in something like:

                  animal lover

                  and it says “hello, animal lover!”

                  its no good to go worrying about how that works, because its more fun to just go to another example. at some point it will click.

                  the big secret is the best part– virtually *all* coding works the same way. there are little details in style, but if you get one language, most others are virtually the same.

                  at least in terms of how they work.

                  the trick is to keep the subject interesting enough to get people to talk about it until they get it.

                  i designed it for everyday people. but i strongly recommend this short story to put it into context:


                  and dont think this is something you *have to do.*

                  my job is to make it interesting enough to entice you to keep learning about it a tiny bit at a time. if i dont succeed, its nothing on you. cheers. we can talk about it for as long as you want, and as often as you like, until you get bored with it. then, no worries.

                  Liked by 1 person

                    1. oh yeah– on your schedule, thats key. im not going to tell you what to do, let alone when to do it šŸ™‚ if you want to do any of it, it will be at your own pace. goodnight. šŸ™‚

                      Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s