Remix.run Logo
susam 3 days ago

Glad to see Forth on HN today!

For anyone who likes playing with small experimental projects, I once made a minimal, esoteric canvas colouring language inspired by Forth and Tixy: https://susam.net/fxyt.html

nottwo 2 days ago | parent | next [-]

This is fun!

I was going to try to draw a circle but was missing sin/sqrt. Then I thought of using a lookup table but got stumped.

Do you have any pointers for drawing a circle?

I'm looking at demo #4 (https://susam.net/fxyt.html#XYpTN1srN255pTN1sqD) to see where the circular shapes are coming from.

Have you seen Forth Haiku? https://forthsalon.appspot.com/

onirom 2 days ago | parent | next [-]

doesn't need to be accurate, could do something like this (distance + treshold) :

https://susam.net/fxyt.html#XN128dXN128dpYN128dYN128dpsN4096...

smaller with dup :

https://susam.net/fxyt.html#XN128dDpYN128dDpsN4096lN255pC

circles pattern : https://susam.net/fxyt.html#XDpYDpsN8qN3riN255pC

PS: fun tool !

nottwo 2 days ago | parent [-]

Oh, thanks!

X^2 + y^2 > z^2 ? 1 : 0

mabster 2 days ago | parent | prev [-]

Was also gonna jump in with the old way of doing circle boundaries, which can be done all integer: https://en.m.wikipedia.org/wiki/Midpoint_circle_algorithm

glimshe 3 days ago | parent | prev [-]

Very cool! It would be even better if you had a Library of preset demo programs for people to hack and see the power of your tool

Edit: I saw them on GitHub. But I've also seen some tools that put them in the main interface. That would be an improvement IMHO. Great work!

susam 3 days ago | parent [-]

Thank you! Glad you liked it! There are a few demos at the bottom of the help screen, which can be invoked by typing '?'.

You are right that that they could be better linked directly from the main interface.

In any case, here are the direct links to the demos available in the help screen:

https://susam.net/fxyt.html#XYxTN1srN255pTN1sqD

https://susam.net/fxyt.html#XYaTN1srN255pTN1sqN0

https://susam.net/fxyt.html#XYoTN1srN255pTN1sqDN0S

https://susam.net/fxyt.html#XYpTN1srN255pTN1sqD

https://susam.net/fxyt.html#XYN256sTdrD

Community demos are available here:

https://susam.github.io/fxyt/demo.html