Pecola1 wrote:
I think they mean any photos from weebly like:
http://www.weebly.com/images/new/logo.png
O.O I think they updated it, I think the images may work now!
They do!
Offline
I have a question: Why do we have <true> and <false> blocks in the library? I've seen blocks get denied because of 2-block workarounds, yet there are many 1-block workarounds for these, without even having to change the arguments!
For true:
<( ) = ( )>
<not < >>
For false:
<( ) < ( )>
<( ) > ( )>
<< > and < >>
<< > or < >>
Does anyone know why we have them in the library? It seems a little unfair to people who submitted blocks with 2-block workarounds...
Same for many other blocks (this is just from the Scratch section):
(error) = (0 / 0)
([1/10 v] as decimal = (1 / number)
<( ) is divisible by ( )> = <(number mod number) = 0>
(- ( )) = (-1 * number)
([1/2 v] of ( )) = ((number / number) * number)
<< > = < >> is not necessary, becuase booleans fit into <( ) = ( )>.
(< >) : If this reports as a string, then it's not necessary because booleans fit into string arguments.
|go forward ( ) layers| = |go back (negative number) layers|, as stated in block entry
|if < > bounce| = if <boolean> { |turn (180) degrees| }
Please note that no offence is intended by this list. I am merely asking as to why these blocks were accepted while others weren't.
Last edited by Greenatic (2011-10-29 19:27:23)
Offline
Of course I take no offence, it is a valid point. Personally, I believe that the reason that the true and false blocks were accepted is because firstly they are available in Panther, and secondly, and more importantly, true and false are boolean statements that appear in most every programming language and therefore are something Scratch is potentially missing.
Once I get the block library site up and running (its MySQL is causing no end of problems for me) this won't be a problem anymore since the search features will reduce the cluttering we would currently experience with the library at present since searching cannot be narrowed more that categories.
I'm off to work now, but when I get back I'll be sure to instate you as a full librarian, greenatic, I think you deserve it and would do well on the post!
Last edited by sparks (2011-10-30 05:28:35)
Offline
This block allows you to do an infinite amount of things at once, due to the byob list input option.
Block Picture:
Source Code:
Block Download Link (.ysp sprite):
Download This Block
What it does:
Runs multiple scripts at the same time.
Edit:
I just realized 2 things:
1) The links are broken.
2) Floppy_gunk already made this block.
Last edited by zippynk (2011-10-30 14:35:02)
Offline
Greenatic wrote:
I have a question: Why do we have <true> and <false> blocks in the library? I've seen blocks get denied because of 2-block workarounds, yet there are many 1-block workarounds for these, without even having to change the arguments!
For true:
<( ) = ( )>
<not < >>
For false:
<( ) < ( )>
<( ) > ( )>
<< > and < >>
<< > or < >>
Does anyone know why we have them in the library? It seems a little unfair to people who submitted blocks with 2-block workarounds...
Same for many other blocks (this is just from the Scratch section):
(error) = (0 / 0)
([1/10 v] as decimal = (1 / number)
<( ) is divisible by ( )> = <(number mod number) = 0>
(- ( )) = (-1 * number)
([1/2 v] of ( )) = ((number / number) * number)
<< > = < >> is not necessary, becuase booleans fit into <( ) = ( )>.
(< >) : If this reports as a string, then it's not necessary because booleans fit into string arguments.
|go forward ( ) layers| = |go back (negative number) layers|, as stated in block entry
|if < > bounce| = if <boolean> { |turn (180) degrees| }
Please note that no offence is intended by this list. I am merely asking as to why these blocks were accepted while others weren't.
[/blocks]
Almost all blocks have a workaround, even the ORIGINAL move () steps! The point is, does it help? See would it make it easier to use or use less blocks or even make it less messy? YES, these Boolean very much help messiness. And therefore the y are helpful and should be kept, thanks for pointing it out though.
Last edited by Pecola1 (2011-10-30 19:22:03)
Offline
Requesting block:
stop all but this script
Type of block:
Stack Block
Requested for:
Any program it would work in
What it would do:
Stop all scripts but the one it's in, then keep going.
Please tell me if you think it's possible. Thanks!
-zippynk
Offline
zippynk wrote:
Requesting block:
stop all but this script
Type of block:
Stack Block
Requested for:
Any program it would work in
What it would do:
Stop all scripts but the one it's in, then keep going.
Please tell me if you think it's possible. Thanks!
-zippynk
I think you mean cap.
I'm BACK!! :DDD
No need to replace me.
And Greenatic, congrats on getting Librarian status!
Last edited by scimonster (2011-10-31 10:02:01)
Offline
.
Updates: [2]
TheSuccessor quit as a Block Librarian.
Greenatic was hired to replace TheSuccessor as a Librarian.
Update carried out by all block librarians, past and present
________________________________________________________________________________
^home
Offline
scimonster wrote:
zippynk wrote:
Requesting block:
stop all but this script
Type of block:
Stack Block
Requested for:
Any program it would work in
What it would do:
Stop all scripts but the one it's in, then keep going.
Please tell me if you think it's possible. Thanks!
-zippynkI think you mean cap.
A cap block IS a stack block. Only there is an extra code for the cap/end blocks.
Offline
Sparks, you can remove that now.
I'm honored to receive this position and appreciate all those who nominated me. Thank you!
BTW, I'm not exactly sure how the numbered blocks for the statistics are produced. Do they have to be uploaded manually each time?
@Scimonster--What was the last Scratch block you added? I can't seem to find the update...
EDIT: Never mind, I found it on page 80. It only affected blocks through the second post of page 72.
I would like to propose the addition of a simple new feature at the first post: A list of all available dropdowns. Dropdowns are commonly used and this would make it quick and easy for contributors. Furthermore, it would be easy to update. What are your opinions on a list like this?
I believe the list for Scratch Blocks is as follows:
A
B
E
F
J
K
O
o
P
p
q
R
t
U
u
V
w
Last edited by Greenatic (2011-11-08 15:33:29)
Offline
I am now proceeding to combine the various list blocks made earlier into two blocks. I will post the code here in case another librarian happens to be able to perform an update before me. "Mode(s) of" will remain a seperate block, since it takes an extra argument.
EDIT: The two megablocks have now been combined.
('%Y of %L' #r #Math:List: 'mean' 'list')
Math: t1 List: t2 | max min line sum t3 t4 a | t1 = 'maximum' ifTrue:[ (self lineCountOfList: t2) asNumberNoError = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. max _ (self getLine: 1 ofList: t2) asNumberNoError. line _ 2. (self lineCountOfList: t2) asNumberNoError - 1 timesRepeat: [(self getLine: line ofList: t2) asNumberNoError > max ifTrue: [max _ (self getLine: line ofList: t2) asNumberNoError]. line _ line + 1]. ^ max]. t1 = 'minimum' ifTrue:[ (self lineCountOfList: t2) asNumberNoError = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. min _ (self getLine: 1 ofList: t2) asNumberNoError. line _ 2. (self lineCountOfList: t2) asNumberNoError - 1 timesRepeat: [(self getLine: line ofList: t2) asNumberNoError < min ifTrue: [min _ (self getLine: line ofList: t2) asNumberNoError]. line _ line + 1]. ^ min]. t1 = 'mean' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ self getLine: 1 ofList: t2]. (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. sum _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [sum _ sum + (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ sum / (self lineCountOfList: t2)]. t1 = 'range' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ 0]. (self lineCountOfList: t2) asNumberNoError = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. max _ (self getLine: 1 ofList: t2) asNumberNoError. line _ 2. (self lineCountOfList: t2) asNumberNoError - 1 timesRepeat: [(self getLine: line ofList: t2) asNumberNoError > max ifTrue: [max _ (self getLine: line ofList: t2) asNumberNoError]. line _ line + 1]. (self lineCountOfList: t2) asNumberNoError = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. min _ (self getLine: 1 ofList: t2) asNumberNoError. line _ 2. (self lineCountOfList: t2) asNumberNoError - 1 timesRepeat: [(self getLine: line ofList: t2) asNumberNoError < min ifTrue: [min _ (self getLine: line ofList: t2) asNumberNoError]. line _ line + 1]. ^ max - min]. t1 = 'median' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. t3 _ #() asOrderedCollection. t4 _ 1. (self lineCountOfList: t2) timesRepeat: [t3 add: (self getLine: t4 ofList: t2) asNumberNoError. t4 _ t4 + 1]. t3 _ t3 asArray sort. t3 _ t3 asOrderedCollection. [t3 size > 2] whileTrue: [t3 removeAt: 1. t3 removeAt: t3 size]. t3 size = 1 ifTrue: [^ t3 at: 1]. ^ (t3 at: 1) + (t3 at: 2) / 2]. t1 = 'sum' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. a _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [a _ a + (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ a]. t1 = 'difference' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. a _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [a _ a - (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ a]. t1 = 'product' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. a _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [a _ a * (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ a]. t1 = 'quotient' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. a _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [a _ a / (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ a].
ScriptableScratchMorph > list ops
listMath ^ #('mean' 'median' #- 'maximum' 'minimum' 'range' #- 'sum' 'difference' 'product' 'quotient' )
Scratch-Blocks> CommandBlockMorph> private> uncoloredArgMorphFor: add:
$Y = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #listMath; choice: 'mean'].
Scratch-Objects > Scriptable Scratch Morph > blocks > defaultArgsFor:
Add right before the last line ( ^ t2 ):
#Math:List: = t4 ifTrue: [t2 size >= 2 ifTrue: [t2 at: 1 put: (t2 at: 1) localized. t2 at: 2 put: self defaultListName]].
Last edited by Greenatic (2011-11-10 21:54:22)
Offline
Greenatic wrote:
BTW, I'm not exactly sure how the numbered blocks for the statistics are produced. Do they have to be uploaded manually each time?
Nope!
Just change the "spec=" or whatever.
Offline
scimonster wrote:
Greenatic wrote:
BTW, I'm not exactly sure how the numbered blocks for the statistics are produced. Do they have to be uploaded manually each time?
Nope!
Just change the "spec=" or whatever.
Do you mean the number block in the first post showing how many blocks are in each category? Yes, they need manual changing. After adding a block (or set of blocks) you need to change all relevant numbers in the home page and stats page, as well as changing the numbers next to sharer names, adding new names if there are any and changing the "top submitter" for the category if need be.
Offline
SSBBM wrote:
sparks wrote:
I'm not sure more is the right term, perhapse it might be worth asking those librarians who haven't been very active if they truly feel they have the time at the moment and then if any step down - even temporarily, we can look for suitable replacements?
I feel that I'm not active. I would be willing to step down if other felt the need.
Nobody really gave their input on this
Offline
I made some shorter code for the (letter (10) of the alphabet) block:
letter: t1 | t2 | t2 _ t1 asNumberNoError. (t2 < 1 or: [t2 > 26]) ifTrue: [self errorFlag]. ^ String with: (Character value: t2 asNumberNoError + 96)
Offline
Shorter code for the <Am I on [costume1]?> block.
onCostume: t1 ^ t1 = (self costumeNameFromNumber: self costumeIndex).
Shorter code for [Switch whether hidden or shown]. "toggle visibility" would be a better name IMO.
switchHide self isHidden: self isHidden not.
Shorter code for the (Number of costumes) block.
^ (media reject: [:t4 | t4 isSound]) size
I could go on... :P
No code is needed for the (my name) block, just change the block specs to ('my name' #r #objName).
<<> = <>> is xor and does the same thing as <[] = []>.
Last edited by MathWizz (2011-11-01 11:12:11)
Offline
MathWizz wrote:
I could go on...
I'm sure you could.
Offline
sparks wrote:
Whoops, sorry SSBBM. Do you want to resign? There's no need to if you don't want to, and providing there is space you'd always be welcome to rejoin.
I'll resign if others fell the need, but I don't necessarily want to. As I said I don't fell like I'm active and so it might be better if I officially resign and someone with more free time take my place.
Offline
Greenatic wrote:
I am now proceeding to combine the various list blocks made earlier into two blocks. I will post the code here in case another librarian happens to be able to perform an update before me. "Mode(s) of" will remain a seperate block, since it takes an extra argument.
http://www.freewebs.com/polyeztahpuppie … oflist.gifCode:
('%Z of %L' #r #MathOp:List: 'sum' 'list')Code:
MathOp: t1 List: t2 | t3 a | t1 = 'sum' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. a _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [a _ a + (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ a]. t1 = 'difference' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. a _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [a _ a - (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ a]. t1 = 'product' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. a _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [a _ a * (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ a]. t1 = 'quotient' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. a _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [a _ a / (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ a].ScriptableScratchMorph > list ops
Code:
listMath ^ #('sum' 'difference' 'product' 'quotient' )Scratch-Blocks> CommandBlockMorph> private> uncoloredArgMorphFor: add:
Code:
$Z = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #listMath; choice: 'sum'].Scratch-Objects > Scriptable Scratch Morph > blocks > defaultArgsFor:
Add right before the last line ( ^ t2 ):Code:
#MathOp:List: = t4 ifTrue: [t2 size >= 2 ifTrue: [t2 at: 1 put: (t2 at: 1) localized. t2 at: 2 put: self defaultListName]].http://www.freewebs.com/polyeztahpuppie … oflist.gif
Code:
('%Y of %L' #r #Average:List: 'mean' 'list')Code:
Average: t1 List: t2 | max min line sum t3 t4 | t1 = 'maximum' ifTrue:[ (self lineCountOfList: t2) asNumberNoError = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. max _ (self getLine: 1 ofList: t2) asNumberNoError. line _ 2. (self lineCountOfList: t2) asNumberNoError - 1 timesRepeat: [(self getLine: line ofList: t2) asNumberNoError > max ifTrue: [max _ (self getLine: line ofList: t2) asNumberNoError]. line _ line + 1]. ^ max]. t1 = 'minimum' ifTrue:[ (self lineCountOfList: t2) asNumberNoError = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. min _ (self getLine: 1 ofList: t2) asNumberNoError. line _ 2. (self lineCountOfList: t2) asNumberNoError - 1 timesRepeat: [(self getLine: line ofList: t2) asNumberNoError < min ifTrue: [min _ (self getLine: line ofList: t2) asNumberNoError]. line _ line + 1]. ^ min]. t1 = 'mean' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ self getLine: 1 ofList: t2]. (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. t3 _ 2. sum _ (self getLine: 1 ofList: t2) asNumberNoError. (self lineCountOfList: t2) - 1 timesRepeat: [sum _ sum + (self getLine: t3 ofList: t2) asNumberNoError. t3 _ t3 + 1]. ^ sum / (self lineCountOfList: t2)]. t1 = 'range' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ 0]. (self lineCountOfList: t2) asNumberNoError = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. max _ (self getLine: 1 ofList: t2) asNumberNoError. line _ 2. (self lineCountOfList: t2) asNumberNoError - 1 timesRepeat: [(self getLine: line ofList: t2) asNumberNoError > max ifTrue: [max _ (self getLine: line ofList: t2) asNumberNoError]. line _ line + 1]. (self lineCountOfList: t2) asNumberNoError = 0 ifTrue: [^ 0]. (self lineCountOfList: t2) = 1 ifTrue: [^ (self getLine: 1 ofList: t2) asNumberNoError]. min _ (self getLine: 1 ofList: t2) asNumberNoError. line _ 2. (self lineCountOfList: t2) asNumberNoError - 1 timesRepeat: [(self getLine: line ofList: t2) asNumberNoError < min ifTrue: [min _ (self getLine: line ofList: t2) asNumberNoError]. line _ line + 1]. ^ max - min]. t1 = 'median' ifTrue:[ (self lineCountOfList: t2) = 0 ifTrue: [^ 0]. t3 _ #() asOrderedCollection. t4 _ 1. (self lineCountOfList: t2) timesRepeat: [t3 add: (self getLine: t4 ofList: t2) asNumberNoError. t4 _ t4 + 1]. t3 _ t3 asArray sort. t3 _ t3 asOrderedCollection. [t3 size > 2] whileTrue: [t3 removeAt: 1. t3 removeAt: t3 size]. t3 size = 1 ifTrue: [^ t3 at: 1]. ^ (t3 at: 1) + (t3 at: 2) / 2].ScriptableScratchMorph > list ops
Code:
listAverages ^ #('mean' 'median' #- 'maximum' 'minimum' 'range' )Scratch-Blocks> CommandBlockMorph> private> uncoloredArgMorphFor: add:
Code:
$Y = t2 ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #listAverages; choice: 'mean'].Scratch-Objects > Scriptable Scratch Morph > blocks > defaultArgsFor:
Add right before the last line ( ^ t2 ):Code:
#Average:List: = t4 ifTrue: [t2 size >= 2 ifTrue: [t2 at: 1 put: (t2 at: 1) localized. t2 at: 2 put: self defaultListName]].
Should these be put into the same block? Sure they are different but they use the same block spec. What do others think?
Offline
@sparks: Thanks, that's what I needed to know. I also left a comment on one of your projects with a question about the account's main site messages.
@Pecola1: I would be willing to consider that. What does everyone else think?
Offline
scimonster wrote:
zippynk wrote:
Requesting block:
stop all but this script
Type of block:
Stack Block
Requested for:
Any program it would work in
What it would do:
Stop all scripts but the one it's in, then keep going.
Please tell me if you think it's possible. Thanks!
-zippynkI think you mean cap.
No, because a cap would stop the script. This would stop all scripts Except for the current one.
Last edited by zippynk (2011-11-01 19:40:59)
Offline
zippynk wrote:
scimonster wrote:
zippynk wrote:
Requesting block:
stop all but this script
Type of block:
Stack Block
Requested for:
Any program it would work in
What it would do:
Stop all scripts but the one it's in, then keep going.
Please tell me if you think it's possible. Thanks!
-zippynkI think you mean cap.
No, because a cap would stop the script. This would stop all scripts Except for the current one.
LOL never thought of that.
Offline