RetroBASIC
Basicprogramming(.org) => Code and examples => Topic started by: Aurel on August 27, 2018, 05:47:33 PM
-
in
-
Hey, wasn't it me who supposed to show new copy/paste tricks?
-
-
-
Aurel, come on. Any information about the source? Where did you find it? Who's the author? Please.
-
It would be nice for sample screen shot.
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...
-
-
-
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).
-
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.
-
Y
-
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!"
-
If anyone cares to, they can run this for a more powerful experience with SpecBAS :)
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...
-
So TOKEN$ could be a whole code file? what about line numbers?
-
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.
-
OK so like Immediate Mode in early Basic's, though I don't think I ever tried a subroutine.
-
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:
sub$="FOR i=1 TO 5: DRAW 100: ROTATE 144: NEXT i"
then for your next inputs, you could do:
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 :)