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

#2951 2012-06-21 15:50:19

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

Re: ITopic: Welcome to your local block library!

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

 

#2952 2012-06-21 16:03:16

Randomno
Scratcher
Registered: 2012-06-04
Posts: 39

Re: ITopic: Welcome to your local block library!

pick random (1) to (10)
, I mean.


http://img209.imageshack.us/img209/5524/randomno.png
I do stuff with stuff. I also stuff stuff.

Offline

 

#2953 2012-06-21 16:10:03

Randomno
Scratcher
Registered: 2012-06-04
Posts: 39

Re: ITopic: Welcome to your local block library!

Randomno wrote:

pick random (1) to (10)
, I mean.

Oh, you know what I mean.


http://img209.imageshack.us/img209/5524/randomno.png
I do stuff with stuff. I also stuff stuff.

Offline

 

#2954 2012-06-21 16:15:28

Randomno
Scratcher
Registered: 2012-06-04
Posts: 39

Re: ITopic: Welcome to your local block library!

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.


http://img209.imageshack.us/img209/5524/randomno.png
I do stuff with stuff. I also stuff stuff.

Offline

 

#2955 2012-06-21 16:17:01

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

Re: ITopic: Welcome to your local block library!

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

 

#2956 2012-06-21 16:21:13

Randomno
Scratcher
Registered: 2012-06-04
Posts: 39

Re: ITopic: Welcome to your local block library!

777w wrote:

Randomno wrote:

777w wrote:


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

How?


http://img209.imageshack.us/img209/5524/randomno.png
I do stuff with stuff. I also stuff stuff.

Offline

 

#2957 2012-06-21 17:02:15

P110
Scratcher
Registered: 2011-04-12
Posts: 500+

Re: ITopic: Welcome to your local block library!

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


Me live on 2.0 now  sad

Offline

 

#2958 2012-06-22 02:45:27

Randomno
Scratcher
Registered: 2012-06-04
Posts: 39

Re: ITopic: Welcome to your local block library!

P110 wrote:

Randomno wrote:

777w wrote:


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

It would be like the answer block.


http://img209.imageshack.us/img209/5524/randomno.png
I do stuff with stuff. I also stuff stuff.

Offline

 

#2959 2012-06-22 03:00:13

P110
Scratcher
Registered: 2011-04-12
Posts: 500+

Re: ITopic: Welcome to your local block library!

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...


Me live on 2.0 now  sad

Offline

 

#2960 2012-06-22 07:35:51

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: ITopic: Welcome to your local block library!

U know what I like about BYOB! Look!
http://i45.tinypic.com/2db5ugm.gif
Opps, heres the pic.
http://i49.tinypic.com/2wg7ihf.gif

Last edited by fetchydog567 (2012-06-22 20:27:48)


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#2961 2012-06-22 20:07:55

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: ITopic: Welcome to your local block library!

I've got a list one!:
the blockspec is: ('list named %s' #r #contentsOfList: 'a list')
NO CODE


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&action=onlineStatus&type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&action=projects&type=newest&return=image&num=1

Offline

 

#2962 2012-06-22 22:19:12

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: ITopic: Welcome to your local block library!

http://i49.tinypic.com/bfou3d.gif

http://i45.tinypic.com/15zl93c.gif


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#2963 2012-06-22 22:51:05

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: ITopic: Welcome to your local block library!

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,
http://i47.tinypic.com/2z5rscn.gif


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#2964 2012-06-22 22:58:59

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: ITopic: Welcome to your local block library!

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.gif

That won't work if the input is negative. Try 0-x.

Last edited by chanmanpartyman (2012-06-22 22:59:28)

Offline

 

#2965 2012-06-22 23:05:14

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: ITopic: Welcome to your local block library!

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.gif

That won't work if the input is negative. Try 0-x.

What does 0-x mean? It worked for me.


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#2966 2012-06-22 23:16:21

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: ITopic: Welcome to your local block library!

Oh my!
http://i48.tinypic.com/1j1eo7.gif


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#2967 2012-06-22 23:31:40

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: ITopic: Welcome to your local block library!

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.gif

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.

Offline

 

#2968 2012-06-23 01:43:39

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: ITopic: Welcome to your local block library!

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?
http://i50.tinypic.com/2z3qa13.gif


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#2969 2012-06-23 01:50:26

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: ITopic: Welcome to your local block library!

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.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#2970 2012-06-23 09:15:40

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

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

 

#2971 2012-06-23 21:28:17

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: ITopic: Welcome to your local block library!

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:
http://i47.tinypic.com/14v2ws3.gif


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#2972 2012-06-23 21:49:25

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: ITopic: Welcome to your local block library!

Yes.

Offline

 

#2973 2012-06-23 21:57:25

tpaley
Scratcher
Registered: 2011-05-22
Posts: 100+

Re: ITopic: Welcome to your local block library!

Here's a cond block made in BYOB (remember to change the booleans the same amount as the actions!):

Example of usage:

http://i46.tinypic.com/11jtekw.gif


Block code:

http://i47.tinypic.com/2hs87j5.gif

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.


http://i49.tinypic.com/2z82h3d.gif

Offline

 

#2974 2012-06-24 01:02:13

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: ITopic: Welcome to your local block library!

Example:
http://i45.tinypic.com/2s8h0us.gif

Code Blocks:
http://i49.tinypic.com/2j5eyox.gif


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#2975 2012-06-24 16:59:45

tpaley
Scratcher
Registered: 2011-05-22
Posts: 100+

Re: ITopic: Welcome to your local block library!

Here's the set draggable block. (Another version)

Example:

http://i48.tinypic.com/2uic6m1.gif

if version:

http://i45.tinypic.com/2u3vdvs.gif

cond version (using the cond block I posted 2 posts ago):

http://i46.tinypic.com/5xpgy1.gif

Last edited by tpaley (2012-06-24 17:07:18)


http://i49.tinypic.com/2z82h3d.gif

Offline

 

Board footer