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

#951 2010-12-24 12:30:43

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

Pecola1, What are the square brackets in smalltalk code used for? I've always wondered. also, what are hashes used for? Such as #mouse and #edge above.

Square brackets are unevaluated code. So, "var ifNotNil: [var this]" will only make var do "this" if var is not nil. It is just like BYOB's "the script" block.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#952 2010-12-24 12:46:58

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

so are they like parenthesi in an equation? where the calculation deals with the result of what's in the parenthesi, not with the contents individually?

e.g. (I know this does not actually work)

setting t1 to 5 rather than 3+2  smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#953 2010-12-24 13:13:41

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

Pecola1, What are the square brackets in smalltalk code used for? I've always wondered. also, what are hashes used for? Such as #mouse and #edge above.

The hashes are like broadcast almost; it means that the computer will look for a code named whatever is after the #.
The [ and ] are (I am not really sure)  Like for conditions such as ifTrue: [^ true].

(I thought you were an expert?)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#954 2010-12-24 13:14:48

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

Me? no! I'm a beginner! I just pick bits of it up as I go along  smile  Why did you think I was an expert?  smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#955 2010-12-24 13:15:07

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

LOL love your new signature sparks!


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#956 2010-12-24 13:16:10

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

Me? no! I'm a beginner! I just pick bits of it up as I go along  smile  Why did you think I was an expert?  smile

Panther.
(At least 60 seconds have to pass between posts. Please wait a little while and try posting again.)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#957 2010-12-24 13:34:59

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

I'm not Panther's programmer though, that's nXIII and a bit of MathWizz. I'm public relations, presentation, webmaster, and if we all worked in the same place, I'd probably make the tea too!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#958 2010-12-24 13:52:56

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

sparks wrote:

Pecola1, What are the square brackets in smalltalk code used for? I've always wondered. also, what are hashes used for? Such as #mouse and #edge above.

The hashes are like broadcast almost; it means that the computer will look for a code named whatever is after the #.
The [ and ] are (I am not really sure)  Like for conditions such as ifTrue: [^ true].

(I thought you were an expert?)

No, #selector is a selector. It is almost identical to a string.

sparks wrote:

I'm not Panther's programmer though, that's nXIII and a bit of MathWizz. I'm public relations, presentation, webmaster, and if we all worked in the same place, I'd probably make the tea too

tongue

Last edited by MathWizz (2010-12-24 13:53:50)


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#959 2010-12-24 14:01:37

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

I'm not Panther's programmer though, that's nXIII and a bit of MathWizz. I'm public relations, presentation, webmaster, and if we all worked in the same place, I'd probably make the tea too!

LOL  lol


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#960 2010-12-24 14:50:32

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

What are example of a selector then? I'd love to know how to use them!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#961 2010-12-24 15:27:19

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

What are example of a selector then? I'd love to know how to use them!

When making a list selector

yourListName
    ^ #('your first list insert' 'your second list insert' 'your third list insert' 'etc.' )


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#962 2010-12-24 18:25:53

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

owetre, you need to supply an image of the blocks that make up your custom blocks! Also a link to a sprite containing the block for each block is appreciated.

glide to random XY and all but ( ) of [list] are already shared and touching mouse and clicked are already blocks!

I said I didn't post the scripts yet. The blocks that make up the blocks. I will do that now. I don't know how to put sprites up to download. My baby cousin came over, so I didn't have the time. I know how to post blocks. I have done it before.

Last edited by owetre18 (2010-12-24 18:27:15)

Offline

 

#963 2010-12-24 18:35:16

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: Welcome to the OLD local block library!

Here, more in more posts.

http://i.imgur.com/8XNoe.gif

http://i.imgur.com/ljEMw.gif

http://i.imgur.com/mKgZW.gif

http://i.imgur.com/UhCoN.gif

http://i.imgur.com/Rbe2a.gif

Offline

 

#964 2010-12-24 18:41:22

owetre18
Scratcher
Registered: 2009-07-01
Posts: 1000+

Re: Welcome to the OLD local block library!

Merry Christmas, Happy Hanukkah, Happy K- Oh, forget it! Santa left you an early present. Here it is!

        [===]
       (   >  )
-----(        )-----
     (          )
     -----------

Snowman, if you didn't know or if it got messed up.

Offline

 

#965 2010-12-24 23:16:55

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

sparks wrote:

What are example of a selector then? I'd love to know how to use them!

When making a list selector

yourListName
    ^ #('your first list insert' 'your second list insert' 'your third list insert' 'etc.' )

Oh! That's an array! #('test' '123') makes an array with items "test" and "123". I was talking about the #test. You can investigate these by opening the workspace, typing the command, selecting it, then pressing alt + i and an inspect widow will pop up. Try it with strings too!  big_smile


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#966 2010-12-25 15:09:58

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: Welcome to the OLD local block library!

Why are you never on Yahoo chat, sparks?  sad


Yawn.

Offline

 

#967 2010-12-25 15:11:10

shadowfan54
Scratcher
Registered: 2010-05-23
Posts: 27

Re: Welcome to the OLD local block library!

<when green flag clicked>
<if imagining and  programming  and sharing>
<go to BYOB>
<end>

Offline

 

#968 2010-12-25 15:12:44

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to the OLD local block library!

Don't spend much time on yahoo I'm afraid, it keeps giving my browser "unresponsive script" messages that are quite annoying. I also have three email accounts so I'm not always on my Scratch one as yahoo won't let me sign in to two at once!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#969 2010-12-25 15:18:13

shadowfan54
Scratcher
Registered: 2010-05-23
Posts: 27

Re: Welcome to the OLD local block library!

im imagining and programming!

Offline

 

#970 2010-12-25 15:25:06

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: Welcome to the OLD local block library!

sparks wrote:

Don't spend much time on yahoo I'm afraid, it keeps giving my browser "unresponsive script" messages that are quite annoying. I also have three email accounts so I'm not always on my Scratch one as yahoo won't let me sign in to two at once!

Do you have Firefox? Then try IE Tab and tell it to not sync cookies. If that doesn't work, try CookieSwap.


Yawn.

Offline

 

#971 2010-12-26 04:30:01

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

ahh - Pecola 1 - The presentation mode blocks?


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#972 2010-12-26 04:44:30

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Welcome to the OLD local block library!

Yeah - I need help now:

Block Spec:  ('Import project' #- #importScratchProject)

And the code for that, and everything else required... Why doesn;t work?


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#973 2010-12-26 08:58:09

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Welcome to the OLD local block library!

-----------NEW BLOCK-----------
i have made the (- ( ) ) block. it reports the negative of a number.

BLOCKSPEC:

Code:

('-%n' #r #negation:)

CODE:

Code:

negation: t1 
    ^ t1 * -1

Last edited by hello12345678910 (2010-12-26 08:58:39)


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#974 2010-12-26 09:23:37

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

Re: Welcome to the OLD local block library!

hello12345678910 wrote:

-----------NEW BLOCK-----------
i have made the (- ( ) ) block. it reports the negative of a number.

BLOCKSPEC:

Code:

('-%n' #r #negation:)

CODE:

Code:

negation: t1 
    ^ t1 * -1

That can be made perfectly with the existing blocks.
((join[-](number) + (0))[/blocks]
the +0 is so that it becomes an integer instead of a string

Offline

 

#975 2010-12-26 10:21:36

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Welcome to the OLD local block library!

scimonster wrote:

hello12345678910 wrote:

-----------NEW BLOCK-----------
i have made the (- ( ) ) block. it reports the negative of a number.

BLOCKSPEC:

Code:

('-%n' #r #negation:)

CODE:

Code:

negation: t1 
    ^ t1 * -1

That can be made perfectly with the existing blocks.
((join[-](number) + (0))[/blocks]
the +0 is so that it becomes an integer instead of a string

(0 - number) is better.   big_smile


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

Board footer