Discuss Scratch

sporked
New to Scratch
4 posts

Scratch debugging help.. no entrance into "repeat until not "

First. the link: http://scratch.mit.edu/projects/22728895/#editor

I have found two significant glitches (bugs?)

The first glitch, is that if you are on a subsequent playthrough, you have to click start TWICE in order to clear the drawn sprites. Any idea how to get it to force the sprites to hide when it starts up? I've done something like in each sprite

onclick flag
moveto x,y
hide
repeat until somevar = 1 (initialized to 0 early on, and set to 1 when its time to appear)
{hide}
else
show

but that still behaves the same, graphics do not disappear when i hit the start button.

The second bug is relating to program logic I have a feeling Now when i strip the repeat until not (tagged as broken repeat) out, and attach the contents of the loop. things process as expected.. but a chance exists that it will match “winning door” and “open door”.. so i thought i'd put a repeat in on everything, so that IF (if (opendoor == winningdoor) OR (opendoor == chosendoor) it would just reset and retry.

It seemed i outsmarted myself, now it does not enter the loop at all…. I'm lost!

I've done my best to explain some of the logic in my sketch (added to comments) If you require further explanation, please ask!


sporked
New to Scratch
4 posts

Scratch debugging help.. no entrance into "repeat until not "

NOT scratch, or plain english, but close enough..
I think the exact syntax would be something like

repeat until ( (opendoor) != ( chosendoor) && (opendoor) != (winningdoor) ) { }

now how do i convert that to scratch…

Last edited by sporked (May 26, 2014 00:02:06)

1234abcdcba4321
Scratcher
1000+ posts

Scratch debugging help.. no entrance into "repeat until not "

Easiest way would be to add a wait 0 secs on that script so that the reset script can do it's thing

I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
sporked
New to Scratch
4 posts

Scratch debugging help.. no entrance into "repeat until not "

That did the trick for graphics refresh. thanks!
now if i can just figure out this logic glitch
jjbrady18
Scratcher
81 posts

Scratch debugging help.. no entrance into "repeat until not "

I think I fixed it: http://scratch.mit.edu/projects/22762837/

'Ford you're turning into a penguin. Stop it.'

Powered by DjangoBB