Discuss Scratch
- Discussion Forums
- » Show and Tell
- » TextScratch - A programming language in Scratch.
- mlcreater
- Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
What do each of those lines mean? Making progress. For some reason I stopped with it - but I am currently having a “compile” function that compiles anything. Still only two commands…
The machine code forlooks likeme = Cat
wait 0.4
me = DogNow I just need to write something that actually executes this code.001
001
000
002
001
0.4
001
000
001
004
000
Also there's errors now!
It looks like possibly the ‘machine code’ representation of each TextScratch statement might with a 000 line, because there are three 000 lines for 3 statements and this would mean each me = _ statement is a 001, then a costume #, then a 000…
However, this separation by 000 implies also that the wait _ statement is 002 + 001 + 0.4 + 001 + 000, which uses the “me = _” statement's 001 code…
page 16
Last edited by mlcreater (Jan. 29, 2021 19:50:52)
← there are 3 sig figs and 0 kumquats
- mybearworld
- Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
You're right with that 000 thing.What do each of those lines mean? Making progress. For some reason I stopped with it - but I am currently having a “compile” function that compiles anything. Still only two commands…
The machine code forlooks likeme = Cat
wait 0.4
me = DogNow I just need to write something that actually executes this code.001
001
000
002
001
0.4
001
000
001
004
000
Also there's errors now!
It looks like possibly the ‘machine code’ representation of each TextScratch statement might with a 000 line, because there are three 000 lines for 3 statements and this would mean each me = _ statement is a 001, then a costume #, then a 000…
However, this separation by 000 implies also that the wait _ statement is 002 + 001 + 0.4 + 001 + 000, which uses the “me = _” statement's 001 code…
page 16
002 + 001 + 0.4 + 001 + 000
002 #wait 001 #number 0.4 #0.4 001 #number end 000 #statement end
Signatures are the only place where assets links still work.
- mybearworld
- Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
I made this for consistency. When I'll add reporters, I'm gonna have to mark the end of a calculation, for example 2+4-var. It can't expect a fixed value. You don't necessarily need a code for the end of a statement though. Each statement can expect a fixed number of arguments (for example wait n seconds expects 1 numbered argument)
So you could do wait 0.4 seconds as002
0.4
Signatures are the only place where assets links still work.
- mlcreater
- Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
Which reporter will be added first?I made this for consistency. When I'll add reporters, I'm gonna have to mark the end of a calculation, for example 2+4-var. It can't expect a fixed value. You don't necessarily need a code for the end of a statement though. Each statement can expect a fixed number of arguments (for example wait n seconds expects 1 numbered argument)
So you could do wait 0.4 seconds as002
0.4
← there are 3 sig figs and 0 kumquats
- Greg8128
- Scratcher
500+ posts
TextScratch - A programming language in Scratch.
Something to note: converting infix notation (e.g. "3 * 5 + 4 - 2 * 2) to assembly code is tricky because of order of operations rules. This is not to say that you shouldn't try; just do your research first. Look up an algorithm for doing it efficiently. Look at documentation for C or Java to see what order of operations rules they used. (you don't have to copy it verbatim. Just note where operators such as <=, == and && fit in).
If it doesn't work out, remember that Lisp doesn't have order of operations but still manages to be a great language.
If it doesn't work out, remember that Lisp doesn't have order of operations but still manages to be a great language.
- gosoccerboy5
- Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
When in doubt, add more parentheses! Simple. If it doesn't work out, remember that Lisp doesn't have order of operations but still manages to be a great language.
Last edited by gosoccerboy5 (Feb. 10, 2021 02:12:40)
- skymover1239
- Scratcher
500+ posts
TextScratch - A programming language in Scratch.
How close is 0.0.2 to be done?
For God so loved the world that he gave his one and only Son that whoever believes in him shall not perish but have eternal life
First time a moderator got ninjaed??
500 Posts
Current Mainline projects
AquaCSS - A CSS framework.
Ink - An editor that does, lots of things.
500 Posts
Current Mainline projects
AquaCSS - A CSS framework.
Ink - An editor that does, lots of things.
- Discussion Forums
- » Show and Tell
- » TextScratch - A programming language in Scratch.