hi, I would like to make a text-based programming language in snap! in the syntax of ENGLISH. I would like as much of help as possible
use map?
¯\(°_o)/¯
First ull want a way of rendering and editing the code.
The [scratchblocks]writesize(10)::pen[/scratchblocks] block should be used for rendering.
You will have to make your own script for key detection.
You can use the [scratchblocks]set key to ::grey[/scratchblocks] block (in a library) to save and load scripts.
Then have a bunch of "if entered text = x, do y" scripts.
You can just use the ask block and a terminal variable for output code. Maybe you would use WRITE if there ends up being a command to use the write block
If you want to learn how to write a parser, this book is pretty good.
like applescript?
you shouldn't start with rendering it. Just put it in a list, and use the ask block first, and make the parser. After you're done with the whole thing, then create a renderer for the programming language.
ok, so it seems like everyone isn't understanding this, I just want everyone to help with a block.
What is the syntax? Can you at least give a specification or a language grammar?
yes. maybe something like
create a script variable called "a"
set the variable "a" to a new empty list (irrelevant)
do the code "hide
wait 1 second
show" 10 times
(but without all those colors)
I know it's supposed to be like english, but that right there is something nobody would want to type, because it's so long.
it's just for fun
ah, ok.
if i made a programming language as readable as possible it would be like this
a = []
repeat 10{
hide
wait 1
show
}
also if it worked like that then it would be like
create an unassigned 64 bit variable called "a" for all sprites
and for loops would look terrifying, it's way easier to do
U64 a;
What are all the weird colors for?
idk, all i know is that i didn't make them
It's trying to syntax highlight, but it doesn't know what language you're using.
then what language is it supposed to be