Not really in the true spirit of turtle (if it doesn't "go forward" I don't count it!), but I had to make this one based on the MAD computer program discussed here yesterday. https://turtletoy.net/turtle/ba15abdde7
Turtletoy
41–50 of 65 posts
Re: Turtletoy
#42Re: Turtletoy
#43But I also like the approach here of using Turtle as a way to introduce JavaScript syntax. :)
Re: Turtletoy
#44I have seen this site some days ago (reddit maybe?) and I really like the concept! The design is very clean! One feature I'd like: A way to slow down the render so we can see the whole generation in slow-motion.
the async way doesn't seem to work inside the walk function, but the older (and uglier imo) way does
As an example here is the modified code for https://turtletoy.net/turtle/eed0f57234
// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(1);
// Global code will be evaluated once.
const turtle = new Turtle();
turtle.penup();
turtle.goto(0,0);
turtle.pendown();
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function pausecomp(millis)
{
var date = new Date();
var curDate = null;
do { curDate = new Date(); }
while(curDate-date
edit: implemented: https://turtletoy.net/turtle/e99ca811adRe: Turtletoy
#45Leigh Klotz was the man who ported MIT Logo to the Apple ][ and then the Commodore 64. According to him “The Commodore 64 CPU 6510 has a bidirectional parallel port at location 0 and 1, taking up 2 of the 256 "page zero" locations, which are the only ones you can indirect through. When I ported MIT Logo from the Apple II, there were lots of places that dereferenced nil without checking, and those caused crashes. Commodore gave me a chip they fabbed in qty 12 yield that brought out the I/D decide status as a pin, and we used a Nicolet-Paratronica logic analyzer to feed the address and data bus to a Pet running a BASIC disassembler. I could then set a breakpoint in-circuit to see the 256 instructions prior to or after the errant memory access, so I could go put on guard code...”
I got it from Jamie Zawinski's weblog. Be forewarned. Following the link from Hacker News will lead to an unsavory image. Just copy & paste it, instead.
https://www.jwz.org/blog/2018/11/weird-machines/#comment-192...
Re: Turtletoy
#46One feature that I wish existed was library import. Or community accepted set of extension modules. An easy way to call polar coordinates, Spirographs, matrix transforms, etc.
Re: Turtletoy
#47Of course Logo wasn't the most complex language ever but I remember being pretty pleased with myself having written a computer program on a bit of paper and it doing exactly what I'd visualised it to do.
Re: Turtletoy
#48I'm seeing some really interesting JavaScript techniques in the turtlevm.js[1] source. This line in particular stands out: const code = String(work).trim().split("{").slice(1).join("{").slice(0, - 1).trim().replace("/0/", _turtlevmapi).replace("/1/", strCode); It looks like the author is injecting the turtle code written by the user into a "work" function that removes dangerous objects (XMLHttpRequest, WebSocket, etc…
Re: Turtletoy
#49This reminds me of a story of how Logo was implemented on 8-bit microcomputers. Leigh Klotz was the man who ported MIT Logo to the Apple ][ and then the Commodore 64. According to him “The Commodore 64 CPU 6510 has a bidirectional parallel port at location 0 and 1, taking up 2 of the 256 "page zero" locations, which are the only ones you can indirect through. When I ported MIT Logo from the Apple II, there were lots…
http://www.dereferer.org/?https%3A%2F%2Fwww%2Ejwz%2Eorg%2Fbl...