Discuss Scratch

0xF3d04a
Scratcher
54 posts

Bug with safe word list

I was creating my safe word list when I noticed something odd, no matter what I typed in it would call the phrase safe(even when it wasn't). I think it has to do with the checker:
if <not <[swl v] contains (item (ptr) of [tmp v])>> then
set [issafe v] to [false]
stop [this script v]
end
Ideas or suggestions?

https://scratch.mit.edu/projects/107080306/

~0xF3d04a

Last edited by 0xF3d04a (April 27, 2016 11:27:00)

MellerReal
Scratcher
88 posts

Bug with safe word list

Works fine for me, I tried @ and it stopped the script.
0xF3d04a
Scratcher
54 posts

Bug with safe word list

I made a little tweak to it and now it's freezing the script instead of sending false back to the demo script. This isn't good either as I need it to send true or false back to the script. Now why is it freezing?
Edit: After further examination it still calls all words safe even when it isn't. The reason it freezes is because the @ symbol is ignored. I'll look into that.
Edit 2: I fixed the freezing bug

Last edited by 0xF3d04a (April 27, 2016 11:54:41)

0xF3d04a
Scratcher
54 posts

Bug with safe word list

I eventually found the bug and it was near where I suspected, I just needed a broader range of the code. I told the loop to keep going until the pointer hit the length of the list of words gathered. Since the pointer started at 1 as that was the first item on the list it stopped itself and prevented it from running in the first place. Changing
(length of [tmp v])
to
((length of [tmp v]) + (1))
worked. Thanks for helping

Powered by DjangoBB