Setting functions:
set function make-a-square($param1, $param2) do /*How could this be formatted to allow for spaces?*/
...
end
Running functions:
make-a-square("param1text","param2text")
How's that?
Setting functions:
set function make-a-square($param1, $param2) do /*How could this be formatted to allow for spaces?*/
...
end
Running functions:
make-a-square("param1text","param2text")
How's that?
void function hello world do
write "hello world" with a new line
end
hello world
then you can't put "do" at the end of function names. make the function name a string
void function "hello world" do
write "hello world" with a new line
end
hello world
also how would you make params
exactly, brackets can be used like this in english.
Not necessarily. Only certain values are legal, so it makes sense to view them as symbols rather than as text.
do ... done
?
so like this
do
//insert code here
done
yeah. Does that feel less weird?
kind of but i still like using
{
//code here
}
or
[
//code here
]
It's not really english syntax though...
i know
Terminal Commands, these run with the "program itself" as an a object.
Create Variable "string" with (value) -- Creates a variable
display(value) -- sort of like the print command in python or console.log in JS
wait (value) sec -- You know what this is, simply pause 1 second
make Object called "string" -- Makes a sprite appear at x:0 y:0, it appears as a TURTLE.
Change (variable name) to (value)
set (object name) to (picture)
do [ -- The Old REPEAT BLOCK
//code
] 10 times
Object Commands, these run with the Object in mind.
tell "object name" to [
//code
] --Tells object to do this.
go to 0, 0, -- go to x, y
pen("down or up") -- Toggles Pen
//what more could I do?
switch pen status
pen down // reports if the pen is down
also if there's
tell object to [
//code
]
then there should be
ask object for (stuff goes here)
also variables are like this
create the variables ($var, $var2)
set $var to 6
set $var2 to 8
set $sum to $var + $var2
write $sum with new line
oh yea
wait 1 sec
should be
sleep 1 sec
repeat is good
but
change $varname to thing
// is just the same as
set $varname to thing
//do you mean
change $varname by 2
make object called "sprite"
should be
make an object called "sprite name"
without the an
, it wouldn't be englishy
I am trying to balance between being englishly and being easy to type commands. you can anyways still read it and it would make sense.
I mean actually do mean
change "var name" to thing,
btw.
oh, i thought that you were talking about
change $var by 2
Why would variables need a dollar sign? It also makes more sense to create each variable separately. There is a reason why both python:
var1 = 1
var2 = 2
and JS:
var var1 = 1;
var var2 = 2;
both need to make the vars separately. It just makes more sense and
create the variables ($var, $var2)
would be ungrammatical if you only needed one variable.
create the variables ($var)
the dollar sign is very useful
1 reports 1 right? what if we created a variable called 1 and set it to 2?
1 would report 1 and $1 would report 2. The dollar sign is to let the computer know that it is a variable