Discuss Scratch

scratchjuniurr
Scratcher
1 post

Scratch++ | A text based Programming Language made in Scratch

Is there any code for key detection like scratch code below
<key [ space] pressed?>
MonkeyBean2
Scratcher
500+ posts

Scratch++ | A text based Programming Language made in Scratch

brrp wrote:

is there any way to do a
try{
/*some code you'll execute"/
return True;
}

catch{
return False;
}
and also a returnable value for a function?
define addition (equation){
return eval( equation);
}

maybe a manual garbage collection system too?

if (1 == 1){
delete myvariable;
}

if myvariable.exists(){
myvariable ++;
}
else{
myvariable = 0;
}

also dictionaries?

define thisthing (request){
var mydictionary = {
“hello”:“a greeting”,
“bye”:“a word”
}
try{
return mydictionary{request};
}
except{
return 0;
}
}
really solid project though!
You can make dictionaries with arrays and functions. Just store the keys and values in an array one after another.
MonkeyBean2
Scratcher
500+ posts

Scratch++ | A text based Programming Language made in Scratch

MonkeyBean2 wrote:

Hmm for some reason this isn't working… It should print out a mandelbrot image… But it just lags…

main.scr/set chars to "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'."§set xb to 0§set yb to 0§§set j to 0§set re to 0.1*yb§set im to 0.1*xb§set reb to re§set imb to im§set i to 0§set shouldbreak to 0§repeat 20*20*50 {§  if ((j % 50) == 1) {§    set line to ""§§    set re to 0.1*yb§    set im to 0.1*xb§    set reb to re§    set imb to im§    set i to 0§    set shouldbreak to 0§  }§§  # loop 50§  if (shouldbreak == 1) {§  } else {§    set rec to re*re - im*im§    set imc to 2 * re * im§    set re to rec + reb§    set im to imc + imb§    if ((re*re + im*im) > 16) {§      set shouldbreak to 1§    }§    change i by 1§  }§§  if ((j % 50) == 0) {§    set line to join(line, letter(i/50.0*length(chars), chars))§§    set yb to yb+1§  }§§  if ((j % 50*20) == 0) {§    print line§    set xb to xb+1§  }§  set j to j + 1§}§
bump
marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

Hopefully I will have time to clean up the code and do some maintenance someday.
MonkeyBean2
Scratcher
500+ posts

Scratch++ | A text based Programming Language made in Scratch

marsmark wrote:

Hopefully I will have time to clean up the code and do some maintenance someday.
ADUTNFRANCEK
Scratcher
13 posts

Scratch++ | A text based Programming Language made in Scratch

Hello! Can you update Scratch++? I would like to program games in it. Help yourself with the Turbo Warp editor.

marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

ADUTNFRANCEK wrote:

Hello! Can you update Scratch++? I would like to program games in it. Help yourself with the Turbo Warp editor.

currently working on it!
ADUTNFRANCEK
Scratcher
13 posts

Scratch++ | A text based Programming Language made in Scratch

Thanks for the reply! Scratch is my favorite project. If you want, you can look at my Objective scratch project. It's like Scratch++ only updated.
JAMESISDOPE2
Scratcher
16 posts

Scratch++ | A text based Programming Language made in Scratch

Last edited by JAMESISDOPE2 (Dec. 22, 2023 11:51:54)

marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

Votick wrote:

how would I use it?? because it goes up when I press enter. it looks like this:


end
move (10) steps
forever
when green flag clicked
it moves the current line downwards. (I know, it's a weird behavior, I will take note of that while I'm making the update)
Jayplayz555
Scratcher
4 posts

Scratch++ | A text based Programming Language made in Scratch

ERTYUIJOPIHGUYFGHVJBUHOIJPOIHUYUTFD

Powered by DjangoBB