I'll give you an idea for a block! [post [string] on Twitter] command block. Good luck, you'll need it.
Offline
You got that idea from me!
Offline
scratchisthebest wrote:
I need help. My new (key pressed) block gets an error, and my <key [space] pressed> block works like my modblock was supposed to!
Can someone help me? I don't do Squeak.
did you keep the top bold part same as before? that would make the key space pressed work just liek the mod block because the header is the same
Offline
Zorbak42 wrote:
I'll give you an idea for a block! [post [string] on Twitter] command block. Good luck, you'll need it.
whoa! that's way way too hard! i can see what i can do, but seeing as the url is probably not "string-sensitive" it's not gonna work.
Offline
Sperry wrote:
Joeman592 wrote:
what about the block: (pick random (1) or (10))
That can easily be achieved by:
set temp to (pick random 1 to 2)
if <temp = 1>
set someOtherVariable to 1
else
set someOtherVariablr to 2
you could even add more numbers to that by using a list.
put the numbers you want in a list, then add the simple script:
[blocks]
<item <pick random( 1 )to( length of list )) of list>
[/blocks]
or, if the possible numbers are an equal distance apart (e.g. 0, 10, 20, 30, etc) you can use the script [blocks]
(( <pick random( 1 )to( 5 )) <*> 10 ))
[/blocks]
this example above will give you either 10, 20, 30, 40 or 50.
Last edited by LS97 (2010-06-18 11:03:31)
Offline
You can get 4 that way!
Offline
@johnny:
4?
Offline
yeah well 4 what?
Offline
Joeman592 wrote:
LS97 wrote:
Joeman592 wrote:
how about... a previous costume block?
no use. just do a
[blocks]<switch to costume[ (( <costume#> <-> 1 ))come on, please?
previousCostume self costumeIndex: self costumeIndex - 1
Offline
johnnydean1 wrote:
You got that idea from me!
Yes, I did. I'm helping you get it.
Offline
LS97 wrote:
Zorbak42 wrote:
I'll give you an idea for a block! [post [string] on Twitter] command block. Good luck, you'll need it.
whoa! that's way way too hard! i can see what i can do, but seeing as the url is probably not "string-sensitive" it's not gonna work.
lol, ya. Many people have tried. Luckily, Scratch 2.0 will probably have a block similar to this.
Offline
LS97 wrote:
Sperry wrote:
Joeman592 wrote:
what about the block: (pick random (1) or (10))
That can easily be achieved by:
set temp to (pick random 1 to 2)
if <temp = 1>
set someOtherVariable to 1
else
set someOtherVariablr to 2you could even add more numbers to that by using a list.
put the numbers you want in a list, then add the simple script:
[blocks]
<item <pick random( 1 )to( length of list )) of list>
[/blocks]
or, if the possible numbers are an equal distance apart (e.g. 0, 10, 20, 30, etc) you can use the script [blocks]
(( <pick random( 1 )to( 5 )) <*> 10 ))
[/blocks]
this example above will give you either 10, 20, 30, 4 or 50.
I think you mean this example above will give you either 10, 20, 30, 40, 50.
Offline
Joeman592 wrote:
those still wouldnt get what i want. i want a code for pick random 1 or 10 not a thing that gives you 10 20 30 40 50 or something else! PLEASE!
then do [blocks]
<if><( <pick random( 1 )to( 2 )) <=> 1 )>
<set{ whatever }to( 1 >
<else>
<set{ whatever }to( 10 >
Offline
LS97 wrote:
Joeman592 wrote:
those still wouldnt get what i want. i want a code for pick random 1 or 10 not a thing that gives you 10 20 30 40 50 or something else! PLEASE!
then do [blocks]
<if><( <pick random( 1 )to( 2 )) <=> 1 )>
<set{ whatever }to( 1 >
<else>
<set{ whatever }to( 10 >
Nobody Thought Of That Before? ROFLOL!
Last edited by TheGameMaster1231 (2010-06-18 11:03:35)
Offline
Zorbak42 wrote:
I think you mean this example above will give you either 10, 20, 30, 40, 50.
yep. typo. fixed
Offline
TheGameMaster1231 wrote:
LS97 wrote:
Joeman592 wrote:
those still wouldnt get what i want. i want a code for pick random 1 or 10 not a thing that gives you 10 20 30 40 50 or something else! PLEASE!
then do [blocks]
<if><( <pick random( 1 )to( 2 )) <=> 1 )>
<set{ whatever }to( 1 >
<else>
<set{ whatever }to( 10 >Nobody Thought Of That Before? ROFLOL!
[/blocks]Well, you could use
[blocks](( <pick random( 0 )to( 1 <*> 10 ))[/blocks]
sorry, that doesn't look right when I post it..
< < pick random ( 0 ) to ( 1 ) > * <10> >
Last edited by nXIII (2010-06-18 12:12:31)
Offline
your pick random 1 to 0 set var to this is not what i want. you wouldn't get the same hting with 1 to 10, i want 1 OR 10, which gets you the answer of 1 IOR 10, to just 2 numbers next to each other. PLEASE UNDERSTAND!
EDIT: Wow, looking back at this today makes me realize that what you did is genius.
Last edited by Joeman592 (2011-05-24 23:14:10)
Offline
if what you want to get as an answer is
'1'
or
'10'
then my method is perfect.
if what you want to get is
'1, 10'
or
'10, 1'
then just change the set variable to whatever it has to be.
if it's neither of these, explain youself better!
Offline
Joeman592 wrote:
your pick random 1 to 0 set var to this is not what i want. you wouldn't get the same hting with 1 to 10, i want 1 OR 10, which gets you the answer of 1 IOR 10, to just 2 numbers next to each other. PLEASE UNDERSTAND!
Let me show you my evaluation of my example:
(pick random 0 to 1) -> 1 or 0
(answer * 10) -> 10 or 0.
If you want 1 or 10, just use
(((pick random 0 to 1) * 9) + 1)
the general algorithm would be
(((pick random 0 to 1) * (difference between two numbers)) + (smaller number))
Offline
Joeman592 wrote:
ok...i get it now...thanks nXIII and LS97
no problem! happy to help!
Offline