📜 ⬆️ ⬇️

Programming in Piet language for gophers

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

Piet

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

')
And this 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 a red gopher, pushing onto the stack is a small light red thing next to his leg)
2. Enter the number of years X and push it onto the stack (blue squiggle)
3. divide (red gizmo to the right of blue squiggle)
4. display the result (pink shit that goes to the caterpillar)
5. complete the work (the combination of the form of pink horseradish with black frame)

I painted everything else just like that.

You can read about the Piet language here .
Download interpreter - here
Simple IDE under Piet (the interpreter is not needed separately) - here .

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

If all this is interesting, lay out the translation of the description of the language (so far ready to 20 percent).

Source: https://habr.com/ru/post/42738/


All Articles