Randomno wrote:
I have an idea for a block: random number. It reports the most recent number chosen by the
pick random [1] to [10]block.
you can just set a variable and do that
Offline
777w wrote:
Randomno wrote:
I have an idea for a block: random number. It reports the most recent number chosen by the
pick random [1] to [10]block.you can just set a variable and do that
My idea is faster.
Offline
Randomno wrote:
777w wrote:
Randomno wrote:
I have an idea for a block: random number. It reports the most recent number chosen by the
pick random [1] to [10]block.you can just set a variable and do that
My idea is faster.
but it would probably end up being more complicated trying to work with
Offline
777w wrote:
Randomno wrote:
777w wrote:
you can just set a variable and do thatMy idea is faster.
but it would probably end up being more complicated trying to work with
How?
Offline
Randomno wrote:
777w wrote:
Randomno wrote:
My idea is faster.but it would probably end up being more complicated trying to work with
How?
Because you can use multiple variables in the other method, here there is just one, which keeps getting reset, whereas a variable can be left alone, while a different one is set
Offline
P110 wrote:
Randomno wrote:
777w wrote:
but it would probably end up being more complicated trying to work withHow?
Because you can use multiple variables in the other method, here there is just one, which keeps getting reset, whereas a variable can be left alone, while a different one is set
It would be like the answer block.
Offline
Randomno wrote:
P110 wrote:
Randomno wrote:
How?Because you can use multiple variables in the other method, here there is just one, which keeps getting reset, whereas a variable can be left alone, while a different one is set
It would be like the answer block.
ok, since I'm off ill I'll have a go...
Offline
U know what I like about BYOB! Look!
Opps, heres the pic.
Last edited by fetchydog567 (2012-06-22 20:27:48)
Offline
I've got a list one!:
the blockspec is: ('list named %s' #r #contentsOfList: 'a list')
NO CODE
Offline
Offline
777w wrote:
Randomno wrote:
I have an idea for a block: random number. It reports the most recent number chosen by the
pick random [1] to [10]block.you can just set a variable and do that
For me, I can just do this,
Offline
fetchydog567 wrote:
U know what I like about BYOB! Look!
Opps, heres the pic.
That won't work if the input is negative. Try 0-x.
Last edited by chanmanpartyman (2012-06-22 22:59:28)
Offline
chanmanpartyman wrote:
fetchydog567 wrote:
U know what I like about BYOB! Look!
http://i45.tinypic.com/2db5ugm.gif
Opps, heres the pic.
http://i49.tinypic.com/2wg7ihf.gifThat won't work if the input is negative. Try 0-x.
What does 0-x mean? It worked for me.
Offline
Oh my!
Offline
fetchydog567 wrote:
chanmanpartyman wrote:
fetchydog567 wrote:
U know what I like about BYOB! Look!
http://i45.tinypic.com/2db5ugm.gif
Opps, heres the pic.
http://i49.tinypic.com/2wg7ihf.gifThat won't work if the input is negative. Try 0-x.
What does 0-x mean? It worked for me.
It worked for you because you probably only used positive numbers, or numbers greater than 0. 0-x is a simple equation. 0 being the number, - being the integer (representing subtraction), and x being the variable, or the input.
Offline
chanmanpartyman wrote:
fetchydog567 wrote:
chanmanpartyman wrote:
That won't work if the input is negative. Try 0-x.What does 0-x mean? It worked for me.
It worked for you because you probably only used positive numbers, or numbers greater than 0. 0-x is a simple equation. 0 being the number, - being the integer (representing subtraction), and x being the variable, or the input.
Like this?
Offline
I wrote:
I made a block:
ask for file with title [Choose a file] accepting extensions [txt doc]Block Spec Code:Code:
('ask for file with title %s accepting extension(s) %s' #r #fileDlg:withExts: 'What file?' 'txt')Actual code:
Code:
fileDlg: t1 withExts: t2 | t3 | t3 _ ScratchFileChooserDialog chooseExistingFileType: #any "extensions: (Array with: t2)" extensions: (t2 findTokens: ' ') title: t1. t3 = 'cancelled' ifTrue:[^ false] ifFalse:[^ t3].
Discussion over this block died (it's not in the library and I couldn't find anything telling me it was rejected), so I'm reposting it.
Offline
fetchydog567 wrote:
chanmanpartyman wrote:
fetchydog567 wrote:
What does 0-x mean? It worked for me.
It worked for you because you probably only used positive numbers, or numbers greater than 0. 0-x is a simple equation. 0 being the number, - being the integer (representing subtraction), and x being the variable, or the input.
Like this?
http://i50.tinypic.com/2z3qa13.gif
((0) - (x))No "join" block.
Last edited by Greenatic (2012-06-23 09:16:01)
Offline
Greenatic wrote:
fetchydog567 wrote:
chanmanpartyman wrote:
It worked for you because you probably only used positive numbers, or numbers greater than 0. 0-x is a simple equation. 0 being the number, - being the integer (representing subtraction), and x being the variable, or the input.Like this?
http://i50.tinypic.com/2z3qa13.gif((0) - (x))No "join" block.
Like this:
Offline
Yes.
Offline
Here's a cond block made in BYOB (remember to change the booleans the same amount as the actions!):
Example of usage:
Block code:
So yeah. Those who do scheme or lisp or stuff like that will know what cond is. Bacically, it's like a whole lot of if/else statements but it's a lot cleaner to look at.
Offline
Example:
Code Blocks:
Offline