Discuss Scratch

Schmalex1
New to Scratch
5 posts

While Loop

If anyone has programmed Python, Java, or something then you probably know about while loops. I need one of those in my project, but I don't know how to put that into Scratch terms. I can make a for loop, but I don't previously know when I need to stop. I was wondering if any brilliant minds out there* could help me.

Any help would be appreciated!

Thanks!!!


*(I don't really care if you have a brilliant mind out there, in there, or if you have a brilliant mind at all. Just help me if you can, please!)
scubajerry
Scratcher
1000+ posts

While Loop

My memory tells me that a WHILE loop checks before it executes, as opposed to a UNTIL loop that checks after it executes.

If that is your definition, Scratch's REPEAT UNTIL is a WHILE loop. To make it exactly like what you are talking about, you need to put a NOT on the condition.

Do While (Stay_in_loop == TRUE)
do something
Enddi

repeat until <not ((Stay_in_loop) = [TRUE])>// which in boolean world is really Stay_in_loop = FALSE
do something
end

Last edited by scubajerry (Dec. 5, 2013 02:41:03)

ErnieParke
Scratcher
1000+ posts

While Loop

This is simple; let me show you how to do these things:

While Loop

while (boolean) {
Code
}

repeat until <not (boolean)>
Code
end

For Loop

for (int i = start; i < end; i++) {
Code
}

set [i v] to (start)
repeat until <not <(i) < [end]>>
code
change [i v] by (1)
end

By the way, welcome Schmalex1 to Scratch! Hopefully you'll be able to transition easily. :)

Welcomes,

ErnieParke

Last edited by ErnieParke (Dec. 5, 2013 03:29:15)


Schmalex1
New to Scratch
5 posts

While Loop

Thanks. I'm new to Scratch, so I didn't know. This kinda makes me look like an idiot, but you learn from your mistakes.

Thanks again!
12424
Scratcher
65 posts

While Loop

repeat while <i am new to scratch ::sensing> ::control
wait ::control
end

My OS is : Windows 3.1 (Changed)



















... {... :: hat control} :: hat control // I bet you can't do that
... (... :: cap control) :: cap control // I bet you can't do that
Check This out
Please don't click here
http://www.pcjs.org/devices/pc/machine/5160/cga/256kb/win101/






























DO NOT CLICK HERE















Are We missing some or wrong? Don't worry
Ⓦⓐⓝⓣ ⓢⓞⓜⓔ ⓑⓤⓑⓑⓛⓔ ⓑⓐⓛⓛ ⓣⓔⓧⓣ ⓖⓞ ⓣⓞ : ⓗⓣⓣⓟ://ⓦⓦⓦ.ⓑⓤⓑⓑⓛⓔⓑⓐⓛⓛⓣⓔⓧⓣ.ⓒⓞⓜ
ɯoɔ˙ʇxǝʇuʍopǝpᴉsdn˙ʍʍʍ//:dʇʇɥ : oʇ oƃ ʇxǝʇ uʍop ǝpᴉsdn ǝɯos ʇuɐM
Want some rainbow text go to :
http://www.glitter-graphics.com/generators/rainbow.php
Ɯαит ƨσмɛ ƨcяαмвℓɛ∂ тɛϰт ɢσ тσ : нттρ://ωωω.ɢℓιттɛя-ɢяαρнιcƨ.cσм/ɢɛиɛяαтσяƨ/ƨcяαмвℓɛ.ρнρ
Click the image to download this (only for chrome)






http://i57.tinypic.com/wr11le.jpg




OS: Microsoft Codename Whistler
Flash Version: Flash 17.0 (release 0)
Browser: Firefox
Users: @click_follow_or_eat @peekaboo3
















and go to
http://atom.smasher.org/





Need help
if <(username) = [12424]> then
I will help you :: list
else
Ask (username) :: list
end
bumpjammy
Scratcher
100+ posts

While Loop


witch is best JavaScript or html


<script>

<img> <img>

<script
koopa_land
Scratcher
100+ posts

While Loop

12424 wrote:

repeat while <i am new to scratch ::sensing> ::control
wait ::control
end
Did I mean

repeat while <...> ::cstart control
...
end

Last edited by koopa_land (July 24, 2015 12:20:05)


This looks like Real:

(if <> then [] else [] :: custom-arg)
phamphucdtp
Scratcher
3 posts

While Loop

if <> then

end
MiniCoder11
Scratcher
100+ posts

While Loop

Please do not necropost. (That's when you post on a topic that hasn't been opened for a long time. This topic is from 2015).

You actually can get a while loop in Scratch. Here is a link to a project with the while loop.

Here is a link to ScratchBlox, a project that gives you access to quality custom blocks as well as blocks not currently in the Scratch editor (and no, just in case you were wondering, it has nothing to do with Roblox): https://scratch.mit.edu/projects/304034009

See inside the project and click on the sprite named “Control”. The “while” block can be found in this sprite. It will look like the “if” block but it will say “while” where the “if” should be.

Last edited by MiniCoder11 (June 21, 2019 04:08:22)


Please let me know if there is anything else I can do to help

Powered by DjangoBB