Author Topic: ?  (Read 3216 times)

Aurel

  • Guest
?
« on: August 27, 2018, 05:47:33 PM »
in
« Last Edit: September 23, 2018, 10:00:41 PM by Aurel »

Tomaaz

  • Guest
Re: LOGO interpreter ?
« Reply #1 on: August 27, 2018, 06:25:43 PM »
Hey, wasn't it me who supposed to show new copy/paste tricks?

Aurel

  • Guest
Re: LOGO interpreter ?
« Reply #2 on: August 28, 2018, 06:30:28 AM »
-
« Last Edit: September 23, 2018, 09:56:46 PM by Aurel »

Tomaaz

  • Guest
Re: LOGO interpreter ?
« Reply #3 on: August 28, 2018, 07:51:01 AM »
Aurel, come on. Any information about the source? Where did you find it? Who's the author? Please.

B+

  • Guest
Re: LOGO interpreter ?
« Reply #4 on: August 28, 2018, 12:17:16 PM »
It would be nice for sample screen shot.

Code: [Select]
GraphicsWindow.Title = "Logo - by Joseph Fischetti"not one of original authors of LOGO:  https://en.wikipedia.org/wiki/Logo_(programming_language)
so must be MS Small Basic coder?

This is really the same as Basic DRAW command, I think, again sample(s) would be nice. Oh looks like it works from run time Input like function.

Oh hey, Write a Draw String and not just draw from a string? That is interesting idea! :)
Then we have makings of editor for a Draw String, hmm...
« Last Edit: August 28, 2018, 12:29:10 PM by B+ »

Aurel

  • Guest
Re: LOGO interpreter ?
« Reply #5 on: August 28, 2018, 12:20:34 PM »
-
« Last Edit: September 23, 2018, 09:57:35 PM by Aurel »

B+

  • Guest
Re: LOGO interpreter ?
« Reply #6 on: August 28, 2018, 12:31:19 PM »
Don't usually think of Basic DRAW as Interpreter!

Really don't need all that parsing and stack stuff, recursive calls could handle repeat section(s).
« Last Edit: August 28, 2018, 12:38:07 PM by B+ »

ZXDunny

  • Guest
Re: LOGO interpreter ?
« Reply #7 on: August 28, 2018, 12:44:17 PM »
Seems to use an internal turtle? So this basically just extracts logo-alike commands from a text string and feeds them one by one to a turtle. Does it handle expressions as arguments? I couldn't see anything that might in there. Also no procedure definitions using the Logo "to" command as far as I can tell. Would be nice if we could add variables and procedures/lists to it.

Aurel

  • Guest
Re: LOGO interpreter ?
« Reply #8 on: August 28, 2018, 01:38:26 PM »
Y
« Last Edit: September 23, 2018, 09:58:29 PM by Aurel »

B+

  • Guest
Re: LOGO interpreter ?
« Reply #9 on: August 28, 2018, 02:04:10 PM »
Seems to use an internal turtle? So this basically just extracts logo-alike commands from a text string and feeds them one by one to a turtle. Does it handle expressions as arguments? I couldn't see anything that might in there. Also no procedure definitions using the Logo "to" command as far as I can tell. Would be nice if we could add variables and procedures/lists to it.

Well with procedures, might like execution redirection with decision mechanism(s).

But there is a point when I say to myself, "Oh heck! Just code it in Basic!"

ZXDunny

  • Guest
Re: LOGO interpreter ?
« Reply #10 on: August 28, 2018, 10:10:26 PM »
If anyone cares to, they can run this for a more powerful experience with SpecBAS :)

Code: [Select]
10 ON ERROR GO sub 30
20 INPUT a$: EXECUTE TOKEN$ a$: GO TO 20
30 PRINT "error!": RETURN

You can type in as much BASIC as you like (and there's a turtle too...) and even store procedures and functions as strings and call them later...

B+

  • Guest
Re: LOGO interpreter ?
« Reply #11 on: August 29, 2018, 04:50:53 AM »
So TOKEN$ could be a whole code file? what about line numbers?

ZXDunny

  • Guest
Re: LOGO interpreter ?
« Reply #12 on: August 29, 2018, 08:26:54 AM »
So TOKEN$ could be a whole code file? what about line numbers?

No, just direct commands. TOKEN$ compiles the text into p-code, EXECUTE runs it (though TOKEN$ is probably redundant as EXECUTE will perform this step if it hasn't already - compiling will slow the interpreter down somewhat though). You can specify many statements using the ":" separator.

B+

  • Guest
Re: LOGO interpreter ?
« Reply #13 on: August 29, 2018, 12:30:31 PM »
OK so like Immediate Mode in early Basic's, though I don't think I ever tried a subroutine.

ZXDunny

  • Guest
Re: LOGO interpreter ?
« Reply #14 on: August 29, 2018, 02:40:39 PM »
OK so like Immediate Mode in early Basic's, though I don't think I ever tried a subroutine.

Subroutines would be pretty easy.

you would input your sub as a line of code assigned to a string variable:

Code: [Select]
sub$="FOR i=1 TO 5: DRAW 100: ROTATE 144: NEXT i"

then for your next inputs, you could do:

Code: [Select]
PLOT SCRW/2, SCRH/2: DEGREES: FOR j=1 TO 10: EXECUTE sub$: ROTATE 36: NEXT j

And that would draw 10 stars rotated. I think :)