This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-15 18:46:47

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Choosing certain random numbers

I can already do this with variables, but I think we need a

(choose random [1] or [2] or [3] or [4])
.  It would be a lot easier to point it in a certain direction randomly.

EDIT:  Why is it orange and why isn't it a type-in block?

Last edited by Firedrake969 (2012-06-15 18:48:33)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#2 2012-06-15 19:05:07

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Choosing certain random numbers

There are many easy workarounds. You would need one number to stand for another though.

Offline

 

#3 2012-06-15 19:05:39

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Choosing certain random numbers

I know.  I just don't like using variables in every game.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#4 2012-06-15 19:19:06

777w
Scratcher
Registered: 2009-02-10
Posts: 1000+

Re: Choosing certain random numbers

Firedrake969 wrote:

I know.  I just don't like using variables in every game.

most games on scratch involve variables, its hard to make a game without them

Offline

 

#5 2012-06-15 19:29:28

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Choosing certain random numbers

777w wrote:

Firedrake969 wrote:

I know.  I just don't like using variables in every game.

most games on scratch involve variables, its hard to make a game without them

You don't even need them for the use I was talking about...

Offline

 

#6 2012-06-15 19:37:59

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Choosing certain random numbers

There's a simple way to do this already.


http://trinary.tk/images/signature_.php

Offline

 

#7 2012-06-15 23:01:01

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Choosing certain random numbers

Firedrake969 wrote:

I can already do this with variables, but I think we need a

<choose random [1] or [2] or [3] or [4]>
.  It would be a lot easier to point it in a certain direction randomly.

EDIT:  Why is it orange and why isn't it a type-in block?

Fixed.

Also, it's easy. But it would get messy if you had to use a lot of these.

Offline

 

#8 2012-06-15 23:35:52

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Choosing certain random numbers

Firedrake969 wrote:

I can already do this with variables, but I think we need a

(choose random [1] or [2] or [3] or [4])
.  It would be a lot easier to point it in a certain direction randomly.

(pick random [1] to [4])
Also to point in a certain direction randomly...
point in direction (pick random [-179] to [180])
And to point in fixed directions randomly (let's say multiples of 90)
point in direction ((pick random [0] to [3]) * [90])

Firedrake969 wrote:

I know.  I just don't like using variables in every game.

Those are necessary.

Last edited by Wes64 (2012-06-15 23:42:56)


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#9 2012-06-17 14:08:24

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Choosing certain random numbers

add [item 1] to [items v]
add [item 2] to [items v]
add [item 3] to [items v] //continue
set [chosen v] to (item (any v) of [items v])

Offline

 

Board footer