|Number of watchers on Github||11|
|Number of open issues||1|
|Average time to close an issue||5 days|
|Average time to merge a PR||about 17 hours|
|Open pull requests||0+|
|Closed pull requests||0+|
|Last commit||over 4 years ago|
|Repo Created||over 5 years ago|
|Repo Last Updated||about 3 years ago|
|Organization / Author||polm|
|Do you use dupdupdraw? Leave a review!|
|View dupdupdraw activity|
|View on github|
|Fresh, new opensource launches 🚀🚀🚀|
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
This is a simple HTML canvas experiment with a forth-like language.
As a quick primer:
Forth is a stack-machine based postfix language. Words in your program are executed in order, and the stack starts empty. A stack is like a list where the first thing you put in is the first thing you pull out.
stack:  program: 2 3 + 4
In many programming languages you might think this adds 3 and 4 and gives an error about 2, but the language for dupdupdraw doesn't work that way. Words are executed from left to right, so...
Trying to use an empty stack or using a word you haven't defined causes an error in a real Forth, but in dupdupdraw it's handled this way:
2 +-> ).
asdf asdf /-> , and a whole program of
asdf asdf asdfwould make a picture that was some shade of gray. Note random values are not consistent between runs of the generator.
Your program (like a tweet) is executed once for every pixel of a 512 by 512 image. The three values at the top (right) end of the stack are the r, g, and b values for that pixel, on a scale of 0 to 255. So [0 0 0] is black, [128 128 128] is grey, and [255 0 0] is red. Values outside the range are simply treated as 255 or 0 appropriately. Leftover values on the stack are ignored.
Some built in keywords change what they do depending on your pixel's location; the most obvious are
y, which evaluate to the value for that pixel's location.
A word in parens is an alias. ? and @ are not keywords, but are often used as random values.
7 4 %-> . A
10 20 digives distance from x: 10, y: 20).
10 7 <-> ,
7 10 <-> . There's no
ifin dupdupdraw, but this can be used in much the same way (
x dup 256 < *is zero where x is not less than 256, for example.)
23 dup-> [23 23])
1 2 swap-> [2 1]
1 2 3 rot-> [2 3 1]
1 2 over-> [1 2 1]
If you have any questions, feel free to ask me on Twitter. Thanks!