Discuss Scratch

penguin_pi
Scratcher
8 posts

how to make a random generator

hi everyone it penguin pi can someone help with making a random generator on scratch it needs to be random in the variables
(☁ score) 

Last edited by penguin_pi (April 24, 2026 02:19:42)

deck26
Scratcher
1000+ posts

how to make a random generator

To generate what? There's already the block

(pick random () to (10))
200mutley16
Scratcher
100+ posts

how to make a random generator

penguin_pi wrote:

hi everyone it penguin pi can someone help with making a random generator on scratch

I can help you
I am quite experinced at this
I have made around 6 random generators
penguin_pi
Scratcher
8 posts

how to make a random generator

ty
200mutley16
Scratcher
100+ posts

how to make a random generator

penguin_pi wrote:

ty
how do you need help?
what aspects can I help with?
penguin_pi
Scratcher
8 posts

how to make a random generator

deck26 wrote:

To generate what? There's already the block

(pick random () to (10))

actually so it appears randomly in the variable
Jlerpy
Scratcher
1000+ posts

how to make a random generator

penguin_pi wrote:

deck26 wrote:

To generate what? There's already the block

(pick random () to (10))

actually so it appears randomly in the variable

What do you mean by this? Do you just mean that it's setting the variable to a random value? I don't understand your goal.
penguin_pi
Scratcher
8 posts

how to make a random generator

Jlerpy wrote:

penguin_pi wrote:

deck26 wrote:

To generate what? There's already the block

(pick random () to (10))

actually so it appears randomly in the variable

What do you mean by this? Do you just mean that it's setting the variable to a random value? I don't understand your goal.

i actually want you to review this project https://scratch.mit.edu/projects/25976404/ and tell me how she manages to randomise the variable
deck26
Scratcher
1000+ posts

how to make a random generator

penguin_pi wrote:

Jlerpy wrote:

penguin_pi wrote:

deck26 wrote:

To generate what? There's already the block

(pick random () to (10))

actually so it appears randomly in the variable

What do you mean by this? Do you just mean that it's setting the variable to a random value? I don't understand your goal.

i actually want you to review this project https://scratch.mit.edu/projects/25976404/ and tell me how she manages to randomise the variable
Which variable? There isn't that much code in there so it's not hard to understand. Most of the code is in the Stage area.
200mutley16
Scratcher
100+ posts

how to make a random generator

penguin_pi wrote:

Jlerpy wrote:

penguin_pi wrote:

deck26 wrote:

To generate what? There's already the block

(pick random () to (10))

actually so it appears randomly in the variable

What do you mean by this? Do you just mean that it's setting the variable to a random value? I don't understand your goal.

i actually want you to review this project https://scratch.mit.edu/projects/25976404/ and tell me how she manages to randomise the variable
she uses lists
Jlerpy
Scratcher
1000+ posts

how to make a random generator

Unless you are asking how they've got

(item (random v) of [list v] :: list)
?

That is a block that still works, but they removed as an option in Scratch 3.0.

If you want it, you could backpack it from this project to drop into your own.
But you can also achieve the same effect with:

(item (pick random (1) to (length of [list v] :: list)) of [list v] :: list)
penguin_pi
Scratcher
8 posts

how to make a random generator

deck26 wrote:

penguin_pi wrote:

Jlerpy wrote:

penguin_pi wrote:

deck26 wrote:

To generate what? There's already the block

(pick random () to (10))

actually so it appears randomly in the variable

What do you mean by this? Do you just mean that it's setting the variable to a random value? I don't understand your goal.

i actually want you to review this project https://scratch.mit.edu/projects/25976404/ and tell me how she manages to randomise the variable
Which variable? There isn't that much code in there so it's not hard to understand. Most of the code is in the Stage area.
yep that is the point tell me how it works
penguin_pi
Scratcher
8 posts

how to make a random generator

200mutley16 wrote:

penguin_pi wrote:

ty
how do you need help?
what aspects can I help with?
how do you randomize a variable using lists
penguin_pi
Scratcher
8 posts

how to make a random generator

Jlerpy wrote:

Unless you are asking how they've got

(item (random v) of [list v] :: list)
?

That is a block that still works, but they removed as an option in Scratch 3.0.

If you want it, you could backpack it from this project to drop into your own.
But you can also achieve the same effect with:

(item (pick random (1) to (length of [list v] :: list)) of [list v] :: list)
thanks
200mutley16
Scratcher
100+ posts

how to make a random generator

penguin_pi wrote:

200mutley16 wrote:

penguin_pi wrote:

ty
how do you need help?
what aspects can I help with?
how do you randomize a variable using lists

you do something like (the start can differ of course)
when green flag clicked
add [example] to [list v]




you repeat the add__ to list (you can name the lists) as much as you need

Last edited by 200mutley16 (April 24, 2026 13:06:39)

Powered by DjangoBB