Hey Pecola1, nice to hear from you, I hope you're having a good holiday!
joefarebrother, I don't see exactly how it's possible to... negative-mix two colours... I think that may be why the block isn't working.
Offline
Greenatic wrote:
YourLocalBlockLib wrote:
I'll try to add them tomorrow morning (for me).
What timezone are you? (I'm pretty sure your timezone doesn't count as personal info, unless you happen to live in a remote desert island in the middle of the Atlantic ocean. )
EDIT: Never mind, I looked at your profile. You're from Israel, right? Are you Jewish? No offence meant--after all, I'm Jewish
You are? Cool. I prefer not to give that information out at the present.
And I'm actually from America (which is why Motion Blocks are colored blue ;P) but made Aliyah.
It seems we have a variety of religions on this topic.
joefarebrother wrote:
Can anyone help me make a panther block called !$Color$ subtract $Color$! it is basicly the oposite of mix. Here is my code:
Code:
| t3 t4 t5 | t3_self colorR: (t1) - self colorR: (t2) t4_self colorG: (t1) - self colorG: (t2) t5_self colorB: (t1) - self colorB: (t2) t3 < 0 ifTrue [ t3_0] t4 < 0 ifTrue [ t4_0] t5 < 0 ifTrue [ t5_0] ^Color r:t3 g:t4 b: t5When I run it it shows an error message complaining that there is nothing more expected for t4. If you work out how to fix it, PLEASE give credit to me!!!
Well, you don't have any periods, and no colons after ifTrue. What do you expect?
I tried fixing those but still got an error.
Sparks, think about green. Remove the yellow. What do you get?
I'll continue the update shortly.
I was expecting to get blasted for telling other people not to finish it.
Offline
scimonster: The error message is when it is setting t4 it says nothing more expected. It isn't anything to do with the ifTrue statements
Offline
Greenatic wrote:
Oh, and scimonster, I just made 4 more blocks.
http://polyeztahpuppies.webs.com/maxx.gif
http://polyeztahpuppies.webs.com/minx.gif
http://polyeztahpuppies.webs.com/maxy.gif
http://polyeztahpuppies.webs.com/miny.gif
Blockspecs:Code:
('max x' #r #MaxX) ('min x' #r #MinX) ('max y' #r #MaxY) ('min y' #r #MinY)Methods:
Code:
MaxX ^ self xpos + (0.5 * self width) MaxY ^ self ypos + (0.5 * self height) MinX ^ self xpos - (0.5 * self width) MinY ^ self ypos - (0.5 * self height)
Greenatic, could you please provide a description of what these do?
It seems to me like they report the borders of the sprite's rectangle that it's in.
@joefarebrother: That's because you didn't add a period. ;P
~~sci
Last edited by YourLocalBlockLib (2011-07-21 03:30:42)
Offline
Greenatic wrote:
The <%n is an integer?> block contains code to test if the number is a decimal.
As scimonster noted, it is much easier to do this:Code:
^ t1 = t1 roundedI think this should be implemented in the block, with credit to Scimonster for the improvement. In addition, the <%n is prime?> block contains the same code to test for a decimal. This should be changed as well, with credit to Scimonster for the improvement.
What is the code to check for a decimal, so I can change it?
~sci
Offline
WOW! I just added 26 blocks! The only other time an update that big has been done in the history of the Library is the last update to the old thread: 31 blocks.
~~ “teh almighty Scimonster„
Last edited by YourLocalBlockLib (2011-07-21 04:14:13)
Offline
Thanks, Sci, it's good that we're back on top of the queue! I'll go ahead and add my "user $String$ is online?" panther block to the download process and the library, since it was a requested block!
Offline
Wait, why was I updating the Library? I thought you hired me to fix grammar. XD XD XD
JK
Offline
Offline
sci: can you please point out my errors then because i am not that good with squeak
Offline
YourLocalBlockLib wrote:
Greenatic wrote:
Oh, and scimonster, I just made 4 more blocks.
http://polyeztahpuppies.webs.com/maxx.gif
http://polyeztahpuppies.webs.com/minx.gif
http://polyeztahpuppies.webs.com/maxy.gif
http://polyeztahpuppies.webs.com/miny.gif
Blockspecs:Code:
('max x' #r #MaxX) ('min x' #r #MinX) ('max y' #r #MaxY) ('min y' #r #MinY)Methods:
Code:
MaxX ^ self xpos + (0.5 * self width) MaxY ^ self ypos + (0.5 * self height) MinX ^ self xpos - (0.5 * self width) MinY ^ self ypos - (0.5 * self height)Greenatic, could you please provide a description of what these do?
It seems to me like they report the borders of the sprite's rectangle that it's in.
@joefarebrother: That's because you didn't add a period. ;P
~~sci
They report the maximum/minimum x/y values a sprite takes up.
Offline
('actual size' #r #area)
area ^self height * self width
Offline
YourLocalBlockLib wrote:
Greenatic wrote:
The <%n is an integer?> block contains code to test if the number is a decimal.
As scimonster noted, it is much easier to do this:Code:
^ t1 = t1 roundedI think this should be implemented in the block, with credit to Scimonster for the improvement. In addition, the <%n is prime?> block contains the same code to test for a decimal. This should be changed as well, with credit to Scimonster for the improvement.
What is the code to check for a decimal, so I can change it?
~sci
[factor > 0] whileTrue: [factor _ factor - 1]. factor = 0 ifTrue: [^ false].
should be replaced with:
factor = factor rounded ifTrue: [^false].
Also, get rid of the temporary variable t1store and replace
t1store _ t1. [t1store > 0] whileTrue: [t1store _ t1store - 1]. t1store = 0 ifFalse: [^ false].
with:
t1 = t1 rounded ifFalse:[^false].
Last edited by Greenatic (2011-07-21 09:22:30)
Offline
Going out somewhere right now, I'll add them when I get back.
Offline
TuragaTreeko wrote:
Code:
('actual size' #r #area)Code:
area ^self height * self width
TuragaTreeko, I was a little bit confused by the term 'actual size'. Do you think it would be better as 'area'?
To go along, here's perimeter:
('perimeter' #r #Perimeter) Perimeter ^ (2 * self height) + (2 * self width)
Offline
('Copy %s ' #- #copy:)
copy: i1 "Made with Scramble by Hardmath123" ScratchTranslator unicodeClipboardPut: i1.
Offline
Hardmath123 wrote:
Code:
('Copy %s ' #- #copy:)Code:
copy: i1 "Made with Scramble by Hardmath123" ScratchTranslator unicodeClipboardPut: i1.
I think Pecola1 made that one, I'll have to give him credit.
Offline
scimonster wrote:
Hardmath123 wrote:
Code:
('Copy %s ' #- #copy:)Code:
copy: i1 "Made with Scramble by Hardmath123" ScratchTranslator unicodeClipboardPut: i1.I think Pecola1 made that one, I'll have to give him credit.
*sigh*
Offline
Also, I made this blocks yesterday for ssss. He/she requested them on another thread, so does it still count as a request? Anyway...
Please note: for the "make (sprite) draggable/undraggable" blocks, I was unable to figure out how to remove mouse-pointer as an option. As such, if you select mouse-pointer, the block will do nothing.
('make self draggable' #- #MakeDraggable) ('make self undraggable' #- #MakeUndraggable) ('make %m draggable' #- #MakeDraggable:) ('make %m undraggable' #- #MakeUndraggable:)
MakeDraggable draggable _ true MakeUndraggable draggable _ false MakeDraggable: t1 t1 = #mouse ifFalse: [t1 draggable: false] MakeUndraggable: t1 t1 = #mouse ifFalse: [t1 draggable: false]
Offline
('Apostrophe' #- #getApos)
getApos ^ ''''
Reports a single apostrophe
Offline
Greenatic wrote:
Also, I made this blocks yesterday for ssss. He/she requested them on another thread, so does it still count as a request? Anyway...
http://polyeztahpuppies.webs.com/makedrag.gif
http://polyeztahpuppies.webs.com/makeundrag.gif
http://polyeztahpuppies.webs.com/makeselfdrag.gif
http://polyeztahpuppies.webs.com/makeselfundrag.gif
Please note: for the "make (sprite) draggable/undraggable" blocks, I was unable to figure out how to remove mouse-pointer as an option. As such, if you select mouse-pointer, the block will do nothing.Code:
('make self draggable' #- #MakeDraggable) ('make self undraggable' #- #MakeUndraggable) ('make %m draggable' #- #MakeDraggable:) ('make %m undraggable' #- #MakeUndraggable:)Code:
MakeDraggable draggable _ true MakeUndraggable draggable _ false MakeDraggable: t1 t1 = #mouse ifFalse: [t1 draggable: false] MakeUndraggable: t1 t1 = #mouse ifFalse: [t1 draggable: false]
I know how.
Offline
Greenatic wrote:
TuragaTreeko wrote:
Code:
('actual size' #r #area)Code:
area ^self height * self widthTuragaTreeko, I was a little bit confused by the term 'actual size'. Do you think it would be better as 'area'?
To go along, here's perimeter:Code:
('perimeter' #r #Perimeter) Perimeter ^ (2 * self height) + (2 * self width)
Yeah. I don't know why I said actual size.
Offline
scimonster wrote:
Greenatic wrote:
Also, I made this blocks yesterday for ssss. He/she requested them on another thread, so does it still count as a request? Anyway...
http://polyeztahpuppies.webs.com/makedrag.gif
http://polyeztahpuppies.webs.com/makeundrag.gif
http://polyeztahpuppies.webs.com/makeselfdrag.gif
http://polyeztahpuppies.webs.com/makeselfundrag.gif
Please note: for the "make (sprite) draggable/undraggable" blocks, I was unable to figure out how to remove mouse-pointer as an option. As such, if you select mouse-pointer, the block will do nothing.Code:
('make self draggable' #- #MakeDraggable) ('make self undraggable' #- #MakeUndraggable) ('make %m draggable' #- #MakeDraggable:) ('make %m undraggable' #- #MakeUndraggable:)Code:
MakeDraggable draggable _ true MakeUndraggable draggable _ false MakeDraggable: t1 t1 = #mouse ifFalse: [t1 draggable: false] MakeUndraggable: t1 t1 = #mouse ifFalse: [t1 draggable: false]I know how.
OK, could you please:
Update the block so mouse-pointer isn't an option.
Tell ssss how to do it so he/she can update the block for his/her mod.
Tell me?
Offline
.
Panther Blocks added: 1
by Sparks [requested]
Update carried out by block librarian: Sparks
________________________________________________________________________________
^home
^updates archive
Offline