Discuss Scratch

EatLikeInsects
New to Scratch
26 posts

"More Blocks" Function Bugged

http://scratch.mit.edu/projects/11060964/

Here is my prototype for a project I am working on. If you click the “See Inside” Button and disconnect the “if boolean1 then” from the define block and disconnect the forever block from the “delete all of ”Keys Pressed“ and then reconnect the other forever to the when flag clicked and run the program (by pressing ”Space" you will see that it works as intended. If you reverse the process you will see it gets stuck in a loop. Maybe this is intended, who knows.

My brower is Chrome 27, and my OS is Windows 8 running on an AMD x64 CPU

Thx
drmcw
Scratcher
1000+ posts

"More Blocks" Function Bugged

Not sure what you're trying to do here but the scripts just seem wrong. The main problem is that in the define block you pass in a parameter called boolean then inside the block have a repeat until boolean = false. I'm sorry but you've passed in something that is either true or false, nothing will change that so your loop will never exit when boolean = true.. I assume you think boolean will always reflect key space pressed, it won't, it is just a snapshot of it's value when it is assigned. If you want to know whether the space key is pressed then use the block key space pressed, don't copy it or pass it as a parameter.

Also repeat until not key space pressed is better than using repeat until key space pressed = false.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
EatLikeInsects
New to Scratch
26 posts

"More Blocks" Function Bugged

That is not the problem. The problem is it gets stuck in a loop.
dracae
Scratcher
1000+ posts

"More Blocks" Function Bugged

I'm not quite sure, but I believe the
“(repeat until boolean1 = false)”
will never end because boolean1 does not update real-time with the space-key-pressed? boolean.
Boolean1 stays what it is, I believe.

(EDIT: Anyways, hope I made sense! )

Last edited by dracae (June 25, 2013 22:24:59)


drmcw
Scratcher
1000+ posts

"More Blocks" Function Bugged

EatLikeInsects wrote:

That is not the problem. The problem is it gets stuck in a loop.

Yes it is the problem. As dracae and I say parameters do not change. Here's a remix to prove it.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
xlk
Scratcher
100+ posts

"More Blocks" Function Bugged

what they mean, when you have a custom block with a bolean entry, like in this case, it takes the boleans state, not which bolean it is.
so, it takes (true), not <if space bar pressed>. In this case, I see you made this way so it could check for different keys. A work around would be switching for a variable, but you'd need to open your project with winrar or similar application…

EatLikeInsects
New to Scratch
26 posts

"More Blocks" Function Bugged

I know that the bolean function only updates whenever it gets set to true. The remix does not help as I need to add an entry for each key and having just the “space” key wont work. Its bugged because it only updates in this way. Can someone provide me with a script that does the same thing without the loop.
EatLikeInsects
New to Scratch
26 posts

"More Blocks" Function Bugged

Its actually a problem with Scratch and the way it defines a boolean. Proof in the updated script: http://scratch.mit.edu/projects/11060964/

Last edited by EatLikeInsects (June 26, 2013 12:42:41)

drmcw
Scratcher
1000+ posts

"More Blocks" Function Bugged

EatLikeInsects wrote:

Its actually a problem with Scratch and the way it defines a boolean. Proof in the updated script: http://scratch.mit.edu/projects/11060964/
All you're proving is that repeat until true = false is an infinite loop.
If you want to put this in bugs and glitches then please do, but it ain't a bug or glitch!

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
EatLikeInsects
New to Scratch
26 posts

"More Blocks" Function Bugged

drmcw wrote:

EatLikeInsects wrote:

Its actually a problem with Scratch and the way it defines a boolean. Proof in the updated script: http://scratch.mit.edu/projects/11060964/
All you're proving is that repeat until true = false is an infinite loop.
If you want to put this in bugs and glitches then please do, but it ain't a bug or glitch!

Actually im repeating until something is false which is different to doing something until true == false which is stupid. What it is is that it doesnt update. So infact it is a bug.

Last edited by EatLikeInsects (June 26, 2013 13:32:56)

DadOfMrLog
Scratcher
1000+ posts

"More Blocks" Function Bugged

EatLikeInsects wrote:

Actually im repeating until something is false

I'm really curious what it is that makes you think the ‘something’ (i.e. the boolean) will become false? -What are you expecting to happen that would make that boolean become false, after starting out true?

Last edited by DadOfMrLog (June 26, 2013 17:31:32)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

EatLikeInsects
New to Scratch
26 posts

"More Blocks" Function Bugged

DadOfMrLog wrote:

EatLikeInsects wrote:

Actually im repeating until something is false

I'm really curious what it is that makes you think the ‘something’ (i.e. the boolean) will become false? -What are you expecting to happen that would make that boolean become false, after starting out true?

The boolean is the “key space pressed” and whenever you unpress it it should stop the loop and wait for you to press the key again.
drmcw
Scratcher
1000+ posts

"More Blocks" Function Bugged

EatLikeInsects wrote:

DadOfMrLog wrote:

EatLikeInsects wrote:

Actually im repeating until something is false

I'm really curious what it is that makes you think the ‘something’ (i.e. the boolean) will become false? -What are you expecting to happen that would make that boolean become false, after starting out true?

The boolean is the “key space pressed” and whenever you unpress it it should stop the loop and wait for you to press the key again.
But that's what we're all trying to tell you, it is not key spaced pressed anymore it is a Boolean value that will not change in the defined block. All you have is a repeat until true == false which as you have said is stupid. Please, please re-read the answers in this thread!

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
DadOfMrLog
Scratcher
1000+ posts

"More Blocks" Function Bugged

EatLikeInsects wrote:

The boolean is the “key space pressed” and whenever you unpress it it should stop the loop and wait for you to press the key again.

OK, I understand what you mean…

Here I'm just vaguely trying to cover all possible thought processes you might have… are you perhaps thinking that the other script (the one that tells the custom block to start up) is still looping around its ‘forever’ loop at the same time as the block's ‘repeat until’ loop is still running, so that's how the boolean gets its value changed…?

If not, why do you think that unpressing the space key changes the value of the boolean? -Are you expecting the boolean to change while it is still running inside the loop of the custom block, even though you don't do anything to the boolean while it is inside the custom block itself?

Last edited by DadOfMrLog (June 26, 2013 18:33:38)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

EatLikeInsects
New to Scratch
26 posts

"More Blocks" Function Bugged

drmcw wrote:

EatLikeInsects wrote:

DadOfMrLog wrote:

EatLikeInsects wrote:

Actually im repeating until something is false

I'm really curious what it is that makes you think the ‘something’ (i.e. the boolean) will become false? -What are you expecting to happen that would make that boolean become false, after starting out true?

The boolean is the “key space pressed” and whenever you unpress it it should stop the loop and wait for you to press the key again.
But that's what we're all trying to tell you, it is not key spaced pressed anymore it is a Boolean value that will not change in the defined block. All you have is a repeat until true == false which as you have said is stupid. Please, please re-read the answers in this thread!

You are the ignorant one arnt you. I have a repeat until KEY SPACE PRESSED UNTIL FALSE which makes sense. And please re-read the answers? Holy Shieet. Im the one who started this post. I read through all of them. I dont want constant jibberjabber over something that i didnt even put in the code. And check the updated code to PROVE YOU WRONG

Last edited by EatLikeInsects (June 26, 2013 20:18:43)

DadOfMrLog
Scratcher
1000+ posts

"More Blocks" Function Bugged

OK, your answer above makes it clear where the misunderstanding lies then.

Let's see if this analogy helps…

You're thinking that the boolean is equal to ‘key space pressed’ all of the time - but that really isn't what is happening.
Honestly, it's really not what it means…

Instead the boolean is a ‘photo snapshot’ of ‘key space pressed’ - think of it as like taking a photo - the boolean is a *photograph* taken of the space key at the precise moment that the custom block starts up. So what that photo shows is whether space was being pressed or not at that exact moment in time - and only at that exact moment.

You can press or unpress the space key as much as you like once the photo has been taken, but it's not going to change what that photo shows, since it was taken at a particular point in time.

Don't think of the boolean as ‘key space pressed’ - instead, it is like a ‘photo’ of ‘key space pressed’ at the one specific point in time that the “Key Tracker” block starts up.

Does that make sense?

Last edited by DadOfMrLog (June 26, 2013 20:57:50)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

dracae
Scratcher
1000+ posts

"More Blocks" Function Bugged

EatLikeInsects wrote:

You are the ignorant one arnt you. I have a repeat until KEY SPACE PRESSED UNTIL FALSE which makes sense. And please re-read the answers? Holy Shieet. Im the one who started this post. I read through all of them. I dont want constant jibberjabber over something that i didnt even put in the code. And check the updated code to PROVE YOU WRONG

Relax… There's no need to shout or point fingers…
We're here to help, not to argue with you or confuse you.
We try our best to help, but we can't do anything if you just yell.
Please calm down, and I think DadofMrLog has an explanation that might clear things up.

drmcw
Scratcher
1000+ posts

"More Blocks" Function Bugged

EatLikeInsects wrote:

drmcw wrote:

EatLikeInsects wrote:

DadOfMrLog wrote:

EatLikeInsects wrote:

Actually im repeating until something is false

I'm really curious what it is that makes you think the ‘something’ (i.e. the boolean) will become false? -What are you expecting to happen that would make that boolean become false, after starting out true?

The boolean is the “key space pressed” and whenever you unpress it it should stop the loop and wait for you to press the key again.
But that's what we're all trying to tell you, it is not key spaced pressed anymore it is a Boolean value that will not change in the defined block. All you have is a repeat until true == false which as you have said is stupid. Please, please re-read the answers in this thread!

You are the ignorant one arnt you. I have a repeat until KEY SPACE PRESSED UNTIL FALSE which makes sense. And please re-read the answers? Holy Shieet. Im the one who started this post. I read through all of them. I dont want constant jibberjabber over something that i didnt even put in the code. And check the updated code to PROVE YOU WRONG
Not in this I'm not. Just to add to the jibber jabber maybe I should've put please, please re-read and understand. I have looked at the updated code and it's still repeat until boolean2 = false which is not the same as repeat until key space pressed = false. Until you can see that I'll leave you to your “bug”.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
EatLikeInsects
New to Scratch
26 posts

"More Blocks" Function Bugged

Ok. Its still a bug that it doesnt update when you unpress the space key. If someone can fix the code then well done, if not then I shall try to do it myself.
Nice people on the forums btw. Very helpful people. Thx
DadOfMrLog
Scratcher
1000+ posts

"More Blocks" Function Bugged

Can I put forward a short script, and ask a couple of questions about how you understand it…?

OK, so this script has three blocks, the first of which waits for space to be pressed, the second sets a variable called “spacecheck”, and the last one waits for that variable to be false:

wait until <key space pressed>
set spacecheck to <key space pressed>
wait until <spacecheck = false>

Once this script is running, what do you expect to happen as you press and release the space key…?

Last edited by DadOfMrLog (June 27, 2013 12:51:59)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

Powered by DjangoBB