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

#1 2010-10-02 18:18:01

Shadowed1
Scratcher
Registered: 2010-01-19
Posts: 100+

Picking random letters and not just numbers

I am creating a word game on Scratch, and I have to have a REALLY long script just to do this. This is what it is:
[blocks]
<when I receive[ start game ]<set{poison letter }to( <pick random( 1 )to( 26<if><( <{ poison letter }> <=> a )><say[ The poison letter is A ]for( 2 )secs>
[/blocks]
And so on until you get to Z. But if you could have this script:
When i recieve poison letter
set poison letter to pick random a-z
say The poison letter is -join- poison letter
I couldn't do it in script form because there was no 'join'.
P.S
[blocks]
<( Scratch <=> awesome!!! )>


*Insert some witty, funny or sarcastic comment here*

Offline

 

#2 2010-10-02 18:28:27

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Picking random letters and not just numbers

Why not make a list of letters A-Z, then use something like this?:
http://i51.tinypic.com/zji7o4.gif
Just sayin'  tongue


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2010-10-02 18:38:10

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: Picking random letters and not just numbers

Harakou wrote:

Why not make a list of letters A-Z, then use something like this?:
http://i51.tinypic.com/zji7o4.gif
Just sayin'  tongue

Harakou has a pretty efficient system going, roll with that.


-End Transmission-

Offline

 

#4 2010-10-04 01:05:03

Shadowed1
Scratcher
Registered: 2010-01-19
Posts: 100+

Re: Picking random letters and not just numbers

Yeah, after i posted this my dad gave me some help and showed me that method.


*Insert some witty, funny or sarcastic comment here*

Offline

 

#5 2010-10-04 01:49:33

Shadowed1
Scratcher
Registered: 2010-01-19
Posts: 100+

Re: Picking random letters and not just numbers

Oh and here is the link to the finished game:
http://scratch.mit.edu/projects/Shadowed1/1333691
smile


*Insert some witty, funny or sarcastic comment here*

Offline

 

#6 2011-12-31 11:42:30

BSH1
Scratcher
Registered: 2011-09-17
Posts: 8

Re: Picking random letters and not just numbers

You should just do this:
<when green flag clicked>
<set{whatever }to(letter<pick random( 1 )to(26)> of wordabcdefghijklmnopqrstuvwxyz)

Offline

 

#7 2011-12-31 13:04:07

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Picking random letters and not just numbers

BSH1 wrote:

You should just do this:
[block]<when green flag clicked>[/block]
<set{whatever }to(letter<pick random( 1 )to(26)> of wordabcdefghijklmnopqrstuvwxyz)

Please, don't necropost  neutral

Last edited by RedRocker227 (2011-12-31 13:04:52)


Why

Offline

 

Board footer