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

#1676 2011-07-20 16:11:46

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

Re: ITopic: Welcome to your local block library!

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.


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

Offline

 

#1677 2011-07-21 00:28:18

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

Re: ITopic: Welcome to your local block library!

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.   tongue  )

EDIT:  Never mind, I looked at your profile.  You're from Israel, right?  Are you Jewish?  No offence meant--after all, I'm Jewish  wink

You are? Cool. I prefer not to give that information out at the present.  wink
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.  tongue

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: t5

When 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.  hmm

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.  tongue

Offline

 

#1678 2011-07-21 03:09:24

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

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


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#1679 2011-07-21 03:30:01

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

Oh, and scimonster, I just made 4 more blocks.   smile

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)


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1680 2011-07-21 03:52:46

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

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 rounded

I 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


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1681 2011-07-21 04:13:52

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

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)


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

#1682 2011-07-21 05:52:32

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

Re: ITopic: Welcome to your local block library!

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!


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

Offline

 

#1683 2011-07-21 06:06:49

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

Re: ITopic: Welcome to your local block library!

Wait, why was I updating the Library? I thought you hired me to fix grammar. XD XD XD
JK

Offline

 

#1684 2011-07-21 06:14:14

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

Re: ITopic: Welcome to your local block library!

Well that was your special "attack"  tongue


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

Offline

 

#1685 2011-07-21 07:18:10

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

Re: ITopic: Welcome to your local block library!

sparks wrote:

Well, that was your special "attack".  tongue

And to think I once talked like this... tongue

Offline

 

#1686 2011-07-21 09:13:54

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Welcome to your local block library!

sci: can you please point out my errors then because i am not that good with squeak


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#1687 2011-07-21 09:15:56

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

YourLocalBlockLib wrote:

Greenatic wrote:

Oh, and scimonster, I just made 4 more blocks.   smile

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

 

#1688 2011-07-21 09:18:48

TuragaTreeko
Scratcher
Registered: 2011-04-24
Posts: 100+

Re: ITopic: Welcome to your local block library!

Code:

('actual size' #r #area)

Code:

area
^self height * self width

http://goo.gl/RDqKF

Offline

 

#1689 2011-07-21 09:20:12

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

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 rounded

I 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

Code:

            [factor > 0]
                whileTrue: [factor _ factor - 1].
            factor = 0 ifTrue: [^ false].

should be replaced with:

Code:

 factor = factor rounded ifTrue: [^false].

Also, get rid of the temporary variable t1store and replace

Code:

t1store _ t1.
    [t1store > 0]
        whileTrue: [t1store _ t1store - 1].
    t1store = 0 ifFalse: [^ false].

with:

Code:

 t1 = t1 rounded ifFalse:[^false].

Last edited by Greenatic (2011-07-21 09:22:30)

Offline

 

#1690 2011-07-21 09:39:53

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

Re: ITopic: Welcome to your local block library!

Going out somewhere right now, I'll add them when I get back.

Offline

 

#1691 2011-07-21 09:44:53

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

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:

Code:

  ('perimeter' #r #Perimeter)
Perimeter
^ (2 * self height) + (2 * self width)

Offline

 

#1692 2011-07-21 09:49:33

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

Re: ITopic: Welcome to your local block library!

Code:

('Copy %s ' #- #copy:)

Code:

copy: i1 
"Made with Scramble by Hardmath123"

ScratchTranslator unicodeClipboardPut: i1.

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

Offline

 

#1693 2011-07-21 09:51:47

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

Re: ITopic: Welcome to your local block library!

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

 

#1694 2011-07-21 09:52:38

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

Re: ITopic: Welcome to your local block library!

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*


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

Offline

 

#1695 2011-07-21 09:54:47

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

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]

Offline

 

#1696 2011-07-21 09:54:57

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

Re: ITopic: Welcome to your local block library!

Code:

('Apostrophe' #- #getApos)

Code:

getApos
^ ''''

Reports a single apostrophe


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

Offline

 

#1697 2011-07-21 09:56:06

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

Re: ITopic: Welcome to your local block library!

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

 

#1698 2011-07-21 10:13:43

TuragaTreeko
Scratcher
Registered: 2011-04-24
Posts: 100+

Re: ITopic: Welcome to your local block library!

Greenatic wrote:

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:

Code:

  ('perimeter' #r #Perimeter)
Perimeter
^ (2 * self height) + (2 * self width)

Yeah. I don't know why I said actual size.


http://goo.gl/RDqKF

Offline

 

#1699 2011-07-21 10:22:08

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: ITopic: Welcome to your local block library!

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

 

#1700 2011-07-21 10:51:01

YourLocalBlockLib
Scratcher
Registered: 2011-03-10
Posts: 100+

Re: ITopic: Welcome to your local block library!

.                              http://welcometoyourlocalblocklibrary.weebly.com/uploads/7/1/1/0/7110842/292223741.gif

Panther Blocks added: 1
http://dl.dropbox.com/u/6273449/60.gif by Sparks [requested]

Update carried out by block librarian: Sparks
________________________________________________________________________________
^home
^updates archive


http://dl.dropbox.com/u/6273449/BlockLibraryTitle.png

Offline

 

Board footer