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

#601 2010-12-11 04:10:57

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Welcome to the OLD local block library!

Code:

('%b=%b' #b #a:equalsb:)

Code:

a:t1 equalsb:t2
t1 = t2 ifTrue [^true].
^false.

reports true if the two values are equal.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#602 2010-12-11 04:12:46

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Welcome to the OLD local block library!

zorket wrote:

blockspec:

('do nothing' #- #doNothing)

Code:

doNothing
^ self

TESTED

Actually, EVERY block has a code, sometimes the code is already there.

('do nothing' #- #-)

Modified, only blockspec needed. Kinda ironic, really, you saying

Actually, EVERY block has a code, sometimes the code is already there.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#603 2010-12-11 10:01:45

ESN
New Scratcher
Registered: 2010-12-03
Posts: 100+

Re: Welcome to the OLD local block library!

The fraction of block!

Image code:

http://i52.tinypic.com/359bgb6.png

Operators block.

blockSpecs code:

('%z of %n' #r #computeFraction:of: '1/2' #-)

Now you may not recognize computeFraction:of: or %z.

To get computeFraction:of: :

Go to Scratch-Blocks >> ScriptableScratchMorph >> other ops

And type in this code:

computeFractionOf: code

computeFraction: t1 of: t2
    '1/2' = t1 ifTrue: [^ t2 / 2].
    '1/3' = t1 ifTrue: [^ t2 / 3].
    '1/4' = t1 ifTrue: [^ t2 / 4].
    '1/5' = t1 ifTrue: [^ t2 / 5].
    '1/6' = t1 ifTrue: [^ t2 / 6].
    '1/7' = t1 ifTrue: [^ t2 / 7].
    '1/8' = t1 ifTrue: [^ t2 / 8].
    '1/9' = t1 ifTrue: [^ t2 / 9].
    '1/10' = t1 ifTrue: [^ t2 / 10].
    ^ 0

Then make this in ScriptableScratchMorph as well:

mathFractionNames code

mathFractionNames
    ^ #('1/2' '1/3' '1/4' '1/5' '1/6' '1/7' '1/8' '1/9' '1/10' )

To get %z:

Go to Scratch-Objects >> CommandBlockMorph >> -- all -- >> uncoloredArgMorphFor:

and type in this code:

uncoloredArgMorphFor: code

$z = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #mathFractionNames;
     choice: '1/2'].

And you'll have your fraction of block!


http://is.gd/jZ5chhttp://is.gd/jZhXDhttp://is.gd/jZhU7

Offline

 

#604 2010-12-11 10:13:59

StrykerV
New Scratcher
Registered: 2010-06-15
Posts: 51

Re: Welcome to the OLD local block library!

ESN wrote:

The fraction of block!

Image code:

http://i52.tinypic.com/359bgb6.png

Operators block.

blockSpecs code:

('%z of %n' #r #computeFraction:of: '1/2' #-)

Now you may not recognize computeFraction:of: or %z.

To get computeFraction:of: :

Go to Scratch-Blocks >> ScriptableScratchMorph >> other ops

And type in this code:

computeFractionOf: code

computeFraction: t1 of: t2
    '1/2' = t1 ifTrue: [^ t2 / 2].
    '1/3' = t1 ifTrue: [^ t2 / 3].
    '1/4' = t1 ifTrue: [^ t2 / 4].
    '1/5' = t1 ifTrue: [^ t2 / 5].
    '1/6' = t1 ifTrue: [^ t2 / 6].
    '1/7' = t1 ifTrue: [^ t2 / 7].
    '1/8' = t1 ifTrue: [^ t2 / 8].
    '1/9' = t1 ifTrue: [^ t2 / 9].
    '1/10' = t1 ifTrue: [^ t2 / 10].
    ^ 0

Then make this in ScriptableScratchMorph as well:

mathFractionNames code

mathFractionNames
    ^ #('1/2' '1/3' '1/4' '1/5' '1/6' '1/7' '1/8' '1/9' '1/10' )

To get %z:

Go to Scratch-Objects >> CommandBlockMorph >> -- all -- >> uncoloredArgMorphFor:

and type in this code:

uncoloredArgMorphFor: code

$z = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #mathFractionNames;
     choice: '1/2'].

And you'll have your fraction of block!

Awesome, I just tested it! Although, it might've been easier to do (say, 10) / (2). But it still works great!


99.9999% Crazy, 0.0001% Hamburgeh Makeh  smile

Offline

 

#605 2010-12-11 10:30:01

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

meowmeow55 wrote:

SSBBM wrote:

Man, I have no idea what you guys are saying with your scratch code. Could anyone help me with coming up with BYOB block?

And I'm over here, wishing that people would stop coming up with BYOB blocks, 'cause I'm getting overloaded with building the BYOB Block Library project.  tongue

sparks, can you compile a list of BYOB blocks not in the project and provide easy access to them? 'Cause I'm, er, sorta behind  tongue

I see you will not help me.  lol  Already ahead of you, sparks.

http://i52.tinypic.com/kbvwpl.gif
http://i54.tinypic.com/18fyf9.gif
http://i55.tinypic.com/1znn6yx.gif
http://i51.tinypic.com/2iiwgsl.gif
http://i52.tinypic.com/iqa7ow.gif
^ By subzerostig
http://img121.imageshack.us/img121/3469/83319362.png
http://img684.imageshack.us/img684/9319/negofscripts.gif
^ By me

Oh, and the hyperpaint blocks.

Just add those blocks to this


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#606 2010-12-11 12:14:20

ESN
New Scratcher
Registered: 2010-12-03
Posts: 100+

Re: Welcome to the OLD local block library!

StrykerV wrote:

Awesome, I just tested it! Although, it might've been easier to do (say, 10) / (2). But it still works great!

Thanks!


http://is.gd/jZ5chhttp://is.gd/jZhXDhttp://is.gd/jZhU7

Offline

 

#607 2010-12-11 13:18:09

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

Re: Welcome to the OLD local block library!

I have a Operator block for BYOB Here is the pictures:http://www.weebly.com/uploads/5/4/1/3/5413503/8943546.png

http://www.weebly.com/uploads/5/4/1/3/5413503/6633923.png


to download click this link: http://www.weebly.com/uploads/5/4/1/3/5 … _ascii.ysp

Last edited by Pecola1 (2010-12-12 14:03:25)


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

 

#608 2010-12-11 17:19:08

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

Pecola1 wrote:

I have a Operator block for BYOB:
(the word <{ word }> in ascii code)

{script variables ((word in ascii code))((target)) < >}

<set{ word }to(

<set{ target }to( 1

<repeat( length of <{ word }>
<set{ word }to( join <{ word in ascii code }> join [] ascii code of letter <{ target }> of <{ word }>
<change{ target }by( 1
<end>[/block]

I get confused with fourm blocks. Is this about what to mean?

http://img641.imageshack.us/img641/5564/ascii.gif

If not is still makes a good block, and also makes case sensitive block = easy.

Last edited by SSBBM (2010-12-12 09:01:58)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#609 2010-12-11 17:28:50

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

Re: Welcome to the OLD local block library!

I made a new block. It is below.
Scratch-objects> ScratchSpriteMorph> block specs> block specs:

Code:

('set rotation style to %r' #- #rotationStyleChange:)

Scratch-objects> ScratchSpriteMorph>motion ops

Code:

rotationStyleChange: t1 
    self rotationStyle: t1

Scratch objects> ScratchSpriteMorph>motion ops

Code:

rotationStyleChanger
    ^ #('normal' 'leftRight' 'none' )

Scratch-Blocks> CommandBlockMorph>> -- all -- > uncoleredArgMorphFor:
add the strip...

Code:

$r = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #rotationStyleChanger;
         choice: 'normal'].

and that’s it!

This is what it will look like:

http://www.weebly.com/uploads/5/4/1/3/5413503/6867287.png

Last edited by Pecola1 (2010-12-12 13:49:20)


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

 

#610 2010-12-11 17:58:08

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

Re: Welcome to the OLD local block library!

This block reports the rotation style.
Scratch-objects> ScratchSpriteMorph> block specs> block specs:

Code:

('rotation style' #r #rotationStyle)

Scratch objects> ScratchSpriteMorph> [instance]> motion ops

Code:

rotationStyle
    ^ rotationStyle

Thats all!


This is what it will look like:

http://www.weebly.com/uploads/5/4/1/3/5413503/7078209.png

Last edited by Pecola1 (2010-12-12 13:46:41)


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

 

#611 2010-12-11 18:06:26

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

Re: Welcome to the OLD local block library!

SSBBM wrote:

Pecola1 wrote:

I have a Operator block for BYOB:
(the word word  in ascii code)

{script variables ((word in ascii code))((target)) < >}

set word to []

set target to [1]

{repeat (length of (word))
[set word to( join (word in ascii code) (join [] (ascii code of letter (target) of (word) ) )
change target by [1]

I get confused with fourm blocks. Is this about what to mean?

http://img641.imageshack.us/img641/5564/ascii.gif

If not is still makes a good block, and also makes case sensitive = block easy.

I cannot see the image because I have web blocks and they do not allow me to go to image shack. However I have changed the script to words.
Here is the pictures:http://www.weebly.com/uploads/5/4/1/3/5413503/8943546.png

http://www.weebly.com/uploads/5/4/1/3/5413503/6633923.png

Last edited by Pecola1 (2010-12-12 13:43:10)


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

 

#612 2010-12-11 18:08:50

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

Re: Welcome to the OLD local block library!

Hey can anyone tell me how to create a forum?


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

 

#613 2010-12-11 18:15:29

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

Re: Welcome to the OLD local block library!

Hardmath123 wrote:

Code:

('%b=%b' #b #a:equalsb:)

Code:

a:t1 equalsb:t2
t1 = t2 ifTrue [^true].
^false.

reports true if the two values are equal.

You do notice that you can use the regular
[blocks]
<(       <=>      )>
[/blocks]
block don't you? You can drop booleans into it. like this:

[blocks]
<( <mouse down?> <=>  <loud?>    )>
[/blocks]

Last edited by Pecola1 (2010-12-11 18:19:16)


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

 

#614 2010-12-11 18:43:24

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

Re: Welcome to the OLD local block library!

This block is the
[blocks]
<<  <or>  >>
[/blocks]
block only it choses randomly. So instead of mouse down or touching mouse pointer and the mouse is down but it isn't touching the mouse pointer, it will pick true or false. It is useful if you want a game that is different each time.  big_smile

Scratch-objects> ScriptableScratchMorph> block specs> block specs:

Code:

('%b or %b' #b #booleanRandom:Or:)

Scratch-Objects> ScriptableScratchMorph> other ops:

Code:

booleanRandom: t1 Or: t2
    | t3 |
    t3 _ self randomFrom: 0 to: 1.
    t3 = 1 ifTrue: [^ t1].
    ^ t2

Have fun with your new block!

This is what it looks like:

http://www.weebly.com/uploads/5/4/1/3/5413503/3285541.png

Last edited by Pecola1 (2010-12-12 13:52:13)


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

 

#615 2010-12-12 04:14:47

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

Re: Welcome to the OLD local block library!

HI! Meowmeow55, I've had an idea that I would like to add to the library, but I'd like you hear your (and others') thoughts: Rather than having one big BYOB project containing all the custom blocks, which takes a while to download, and becomes useless once a new version is uploaded, leaving you with several instances of it on your computer, how about we remove the project and replace it with a downloadable sprite per block? I'm happy to help you convert the current project into sprites if you'd like to do it, then people can view the image or download a block, depending what they want? Let me know what you think, then we can split it up between us if you like the idea?

Here's a working example of what the BYOB section would look like:
-------------------------------------------------------------------------------------------------------------------------

http://www.perspector.com/graphics/download_icon.gif   http://www.weebly.com/uploads/4/0/7/6/4076678/5510764.gif Shared by jonathanpb http://i53.tinypic.com/5bqjxh.jpg
-------------------------------------------------------------------------------------------------------------------------

A better download icon, I think, but you get the gist.

It may be possible to do this (or something very similar) for Panther blocks, in 1.0 and I'm hoping 1.1 will have a block importing button built in, but I don't think there's really a way for me to do it with a scratch block unless someone can think of a patch or something that would work...

Last edited by sparks (2010-12-12 05:31:14)


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

Offline

 

#616 2010-12-12 08:12:33

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

Great idea sparks! I could help too!


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#617 2010-12-12 08:18:34

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

Re: Welcome to the OLD local block library!

ok, if SSBBM, meowmeow55 and I work together on that... should we host them all in one place? or do we all have our own file hosting places we can use?

shall we allocate ourselves for the moment to different block types so we don't upload two of the same? If you use my example .ypr file as the basis for the others, they can all look the same!

Last edited by sparks (2010-12-12 08:31:52)


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

Offline

 

#618 2010-12-12 08:31:34

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

sparks wrote:

om, if SSBBM, meowmeow55 and I work together on that... should we host them all in one place? or do we all have our own file hosting places we can use?

The only advantage I see in having it at one place is for someone to see all the files at once. Other then that I think it would be easier to use our own.


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#619 2010-12-12 08:35:42

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

Re: Welcome to the OLD local block library!

shall we allocate ourselves for the moment to different block types so we don't upload two of the same? If you use my example .ypr file as the basis for the others, they can all look the same!


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

Offline

 

#620 2010-12-12 08:48:34

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

sparks wrote:

shall we allocate ourselves for the moment to different block types so we don't upload two of the same? If you use my example .ypr file as the basis for the others, they can all look the same!

Yep. Like one of us could do motion and the other one looks or something.


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#621 2010-12-12 08:55:19

ESN
New Scratcher
Registered: 2010-12-03
Posts: 100+

Re: Welcome to the OLD local block library!

Can you please add my Scratch Block?


http://is.gd/jZ5chhttp://is.gd/jZhXDhttp://is.gd/jZhU7

Offline

 

#622 2010-12-12 09:06:21

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

Re: Welcome to the OLD local block library!

ESN, I'll get to your block in a bit, I don't update the blocks instantly, I have a life outside the fora!

SSBBM, lets start that now then. If you want to do control I'll do motion, then we can use those two as trail ones, that I'll update to see if people like it. Then the others can follow  smile

I need a better "downoad" image...


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

Offline

 

#623 2010-12-12 09:08:02

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Welcome to the OLD local block library!

sparks wrote:

SSBBM, lets start that now then. If you want to do control I'll do motion, then we can use those two as trail ones, that I'll update to see if people like it. Then the others can follow  smile

I need a better "downoad" image...

I can't right now, but I'll get to it after I eat some pancake!  smile


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#624 2010-12-12 09:18:08

ESN
New Scratcher
Registered: 2010-12-03
Posts: 100+

Re: Welcome to the OLD local block library!

sparks wrote:

ESN, I'll get to your block in a bit, I don't update the blocks instantly, I have a life outside the fora!

Sorry, I just thought you missed it  smile


http://is.gd/jZ5chhttp://is.gd/jZhXDhttp://is.gd/jZhU7

Offline

 

#625 2010-12-12 09:23:11

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

Re: Welcome to the OLD local block library!

Hi!

Great idea, sparks! I probably could become more organized that way. I could set a folder aside on my site for all the blocks, then have an option to either go directly to that folder from here to browse the blocks or browse them from the block library.

sparks wrote:

...but I don't think there's really a way for me to do it with a scratch block unless someone can think of a patch or something that would work...

You could build off of nXIII's old patcher system for the blocks!  big_smile

Last edited by meowmeow55 (2010-12-12 09:25:25)


Yawn.

Offline

 

Board footer