Discuss Scratch
- Discussion Forums
- » Show and Tell
- » TextScratch - A programming language in Scratch.
- mlcreater
-
Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
Making progress. For some reason I stopped with it - but I am currently having a “compile” function that compiles anything. Still only two commands…What do each of those lines mean?
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)
- mybearworld
-
Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
You're right with that 000 thing.Making progress. For some reason I stopped with it - but I am currently having a “compile” function that compiles anything. Still only two commands…What do each of those lines mean?
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
- Greg8128
-
Scratcher
500+ posts
TextScratch - A programming language in Scratch.
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 as
So you could do wait 0.4 seconds as
002
0.4
- mybearworld
-
Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
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)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.
So you could do wait 0.4 seconds as002
0.4
- mlcreater
-
Scratcher
1000+ posts
TextScratch - A programming language in Scratch.
Which reporter will be added first?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)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.
So you could do wait 0.4 seconds as002
0.4
- 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.
If it doesn't work out, remember that Lisp doesn't have order of operations but still manages to be a great language.When in doubt, add more parentheses! Simple.

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?
- Discussion Forums
- » Show and Tell
-
» TextScratch - A programming language in Scratch.





