I think that you should be able to right click an and block and there would be an option called "Change # of options" or something like that. Then you wouldn't have to but an and block into another and block over and over again.
Sorry if that doesn't make sense, because when I do stuff when I just woke up I can't think straight
Offline
Absolutely! Fully agree. And the same for the OR block too!
Offline
Hmm... I think I might know how to implement that!
Offline
That would be extremely helpful! How many spaces would it have at max though?
Offline
He knows that, he wants it to be easier by selecting how many times it should reapeat automaticly. And I like this idea. I agree.
Offline
rubiks_cube_guy238 wrote:
Hmm... I think I might know how to implement that!
Well, now I'm done!
To enable your version of Scratch to do this, file in this code:
'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 31 December 2009 at 5:42:38 pm'! !CommandBlockMorph methodsFor: 'evaluation'! argumentAt: t1 (#(#totalArgsAnd #totalArgsOr ) includes: selector) ifTrue: [^ argMorphs at: t1]. argPermutation ifNil: [^ argMorphs at: t1]. ^ argMorphs at: (argPermutation at: t1)! ! !CommandBlockMorph methodsFor: 'evaluation'! evaluateWithArgs: t1 | t2 | selector isInfix ifTrue: [^ self evaluateInfixWithArgs: t1]. t2 _ self coerceArgs: t1. (#(#totalArgsAnd #totalArgsOr ) includes: selector) ifTrue: [^ self perform: selector]. (#(#abs #not #rounded #sqrt #truncated ) includes: selector) ifTrue: [^ t2 first perform: selector]. ^ receiver perform: selector withArguments: t2! ! !CommandBlockMorph methodsFor: 'menus'! rightButtonMenu | t1 t2 t3 t4 | t2 _ CustomMenu new. t2 add: 'help' action: #presentHelpScreen. (owner isKindOf: ScratchBlockPaletteMorph) ifFalse: [t2 addLine. (#(#+ #- #* #/ #\\ ) includes: selector) ifTrue: [#(#+ #- #* #/ #mod ) with: #(#+ #- #* #/ #\\ ) do: [:t5 :t6 | t2 add: t5 action: t6]]. (#(#< #= #> ) includes: selector) ifTrue: [#(#< #= #> ) do: [:t6 | t2 add: t6 action: t6]]. (#(#& #| ) includes: selector) ifTrue: [#(#and #or ) with: #(#& #| ) do: [:t5 :t6 | t2 add: t5 action: t6]]. t2 addLine. t2 add: 'duplicate' action: #duplicate. (self owner isKindOf: BlockMorph) ifFalse: [t2 add: 'delete' action: #delete]. (#(#& #| #totalArgsOr #totalArgsAnd ) includes: selector) ifTrue: [t2 addLine. (#(#& #totalArgsAnd ) includes: selector) ifTrue: [t2 add: 'add argument' action: #addAnd] ifFalse: [t2 add: 'add argument' action: #addOr]]]. t3 _ self ownerThatIsA: ScratchFrameMorph. (t3 notNil and: [#(#sensor: #sensorPressed: ) includes: selector]) ifTrue: [t2 addLine. t2 add: 'show ScratchBoard watcher' action: #showSensorBoard]. DebugMenu ifTrue: [t2 addLine. t2 add: 'show tuples' action: #showTuples]. (t4 _ t2 localize; startUp) ifNil: [^ self]. (#(#presentHelpScreen #duplicate #delete ) includes: t4) ifTrue: [^ self perform: t4]. t4 = #showSensorBoard ifTrue: [t3 showSensorBoard. ^ self]. t4 = #showTuples ifTrue: [^ self showTuples]. t1 _ '%n ' , t4 , ' %n'. '\\' = t4 ifTrue: [t1 _ '%n mod %n']. '&' = t4 ifTrue: [t1 _ '%b and %b']. '|' = t4 ifTrue: [t1 _ '%b or %b']. #addAnd = t4 ifTrue: [t1 _ self commandSpec , ' and %b'. t4 _ #totalArgsAnd. self argPermutation: argPermutation , {argMorphs size + 1}]. #addOr = t4 ifTrue: [t1 _ self commandSpec , ' or %b'. t4 _ #totalArgsOr. self argPermutation: argPermutation , {argMorphs size + 1}]. self commandSpec: t1. self selector: t4! ! !CommandBlockMorph methodsFor: 'as yet unclassified'! totalArgsAnd | t1 | t1 _ OrderedCollection new. 1 to: argMorphs size do: [:t2 | t1 add: (self argumentAt: t2) evaluate]. ^ (t1 includes: false) not! ! !CommandBlockMorph methodsFor: 'as yet unclassified'! totalArgsOr | t1 | t1 _ OrderedCollection new. 1 to: argMorphs size do: [:t2 | t1 add: (self argumentAt: t2) evaluate]. ^ t1 includes: true! !
(To learn how to file in, Jens's project xml. To save the .image when you're done, shift-click on the 'R' in the Scratch logo and select 'save image for end user' and confirm everything with 'yes'.)
Once you've filed it in, you will be able to add a space to the
and the block by right-clicking on it (this only works if the block is in the scripts area) and selecting 'add argument'. Best of all, there is no limit to how many spaces you can add!
Enjoy your improved Scratch!
Last edited by rubiks_cube_guy238 (2010-01-01 12:39:40)
Offline
I had an idea you may have something like this:
There are minus and plus signs on both.
If something can't be completed(minus) then it is dark green, if it can be done, it is light green.
Offline
I like Greatdane's version of the idea, simpler than a right-click menu
But this isn't really necessary because of what keikij said.
Offline
agreed
Offline
technoguyx wrote:
But this isn't really necessary because of what keikij said.
But when you stack the blocks, it can get slow, and it takes up WAY more space. So by adding an argument, the block takes up less space, and it is a little faster.
Offline
Greatdane wrote:
I had an idea you may have something like this:
There are minus and plus signs on both.
If something can't be completed(minus) then it is dark green, if it can be done, it is light green.
I don't understand, can you explain that a little more?
Offline
Well, you can use the signs on both sides to expand and keep smaller.
Because you can't make an AND block to 1 space, the minus is shaded green, indicating you can't do that. Because you can expand the AND block, though, the plus is light green, signifying you can expand the block. If it has three spaces, the minus turns light green because you can decrease it to two spaces.
Offline
Cool idea. Very, very cool.
Offline
One problem - how would you remove one of the spaces? You can't just drag it off...
Offline
Jonathanpb wrote:
One problem - how would you remove one of the spaces? You can't just drag it off...
I'm sure there would be an option labeled "remove argument"...
Offline
Jonathanpb wrote:
One problem - how would you remove one of the spaces? You can't just drag it off...
Greatdane wrote:
I had an idea you may have something like this:
There are minus and plus signs on both.
If something can't be completed(minus) then it is dark green, if it can be done, it is light green.
Last edited by Greatdane (2010-01-02 13:17:42)
Offline
BWOG wrote:
I think that you should be able to right click an and block and there would be an option called "Change # of options" or something like that. Then you wouldn't have to but an and block into another and block over and over again.
Sorry if that doesn't make sense, because when I do stuff when I just woke up I can't think straight
No.You can insert an and or or block into an and or or block.
Offline
PyrosTheStickman wrote:
BWOG wrote:
I think that you should be able to right click an and block and there would be an option called "Change # of options" or something like that. Then you wouldn't have to but an and block into another and block over and over again.
Sorry if that doesn't make sense, because when I do stuff when I just woke up I can't think straightNo.You can insert an and or or block into an and or or block.
It takes too much space! Do you read it? Someone else suggested that.
Offline
Vista4563 wrote:
Jonathanpb wrote:
One problem - how would you remove one of the spaces? You can't just drag it off...
I'm sure there would be an option labeled "remove argument"...
I'm sorry, there is no 'remove argument' option... I am working on that but for now you just have to deal with it or not use it
Offline