Gopher Piet Programming

    Good afternoon.
    Crisis, few orders, some free time? It's time to learn how to write important and useful programs in the esoteric language Piet, which uses multi-colored images as operators. I wrote this one:

    program at Piet

    With its help, gophers (and not only) can find out how fast they should breed in order to double their numbers in X years. Working with the program is very simple: you enter X, you get%, which is worth increasing your population in a year.


    And here is how it looks in an enlarged version:
    увеличенная программа


    The algorithm of the program is very simple:
    1. push the number 72 onto the stack (72 is the red gopher, push the small light red thing next to his leg into the stack)
    2. enter the number of years X and push it onto the stack (blue squiggle)
    3. divide (the red contraption is to the right of the blue squiggle)
    4. print the result (pink horseradish going into the caterpillar)
    5. finish the work (combining the shape of the pink horseradish with the black frame)

    Everything else I just painted.

    Read about the Piet language here .
    Download the interpreter - here
    Simple IDE for Piet (the interpreter is not needed separately) - here .

    The source of my program is a small picture at the top.
    The accuracy of the algorithm is not super, but quite decent for gophers (and not only), you can check.

    If all this is interesting, I will post a translation of the description of the language (so far I’m ready for 20 percent).

    Also popular now: