scimonster wrote:
sparks wrote:
http://dl.dropbox.com/u/6273449/BlockLibDiv2.png
http://img692.imageshack.us/img692/4729/97179666.gif Shared by Pecola1.
Blockspec:('report %b or %b randomly' #b #booleanRandom:Or:)
Code:
booleanRandom: t1 Or: t2
| t3 |
t3 _ self randomFrom: 0 to: 1.
t3 = 1 ifTrue: [^ t1].
^ t2What it does:
Reports it's contents. Useful for putting text in areas where it normally can't go. (such as the [go to $Sprites$] block.
http://dl.dropbox.com/u/6273449/BlockLibDiv2.pngNOT WHAT IT DOES!!!!
and also have it %m for scratch.it should say:
Reports either of the booleans randomly
You are a good editor. I have seen that before but I forgot about it.
Offline
Pecola1 wrote:
scimonster wrote:
sparks wrote:
http://dl.dropbox.com/u/6273449/BlockLibDiv2.png
http://img692.imageshack.us/img692/4729/97179666.gif Shared by Pecola1.
Blockspec:('report %b or %b randomly' #b #booleanRandom:Or:)
Code:
What it does:
Reports it's contents. Useful for putting text in areas where it normally can't go. (such as the [go to $Sprites$] block.
http://dl.dropbox.com/u/6273449/BlockLibDiv2.pngNOT WHAT IT DOES!!!!
and also have it %m for scratch.it should say:
Reports either of the booleans randomlyYou are a good editor. I have seen that before but I forgot about it.
Thanks.
sparks makes so many mistakes (spelling/grammar-wise) that I'm thinking of making 'Welcome to your exotic block shop!'
Offline
comp500 wrote:
sparks wrote:
Yes, sorry comp, they're already in the library but thanks all the same for your contribution
The second one isn't in panther or scratch, just byob.
Offline
pause block.
scratch:
('pause' #- #pause)
pause
DialogBoxMorph inform: 'click OK to continue' title: 'paused'
panther:
pause
-
self showInformDialog: 'paused' withText: 'click OK to continue'
shared by sparks and TheSuccessor.
BYOB has pause function already, right?
EDIT: here is the picture:
Last edited by scimonster (2011-01-06 14:55:28)
Offline
comp500 wrote:
comp500 wrote:
sparks wrote:
Yes, sorry comp, they're already in the library but thanks all the same for your contribution
The second one isn't in panther or scratch, just byob.
Offline
comp500 wrote:
comp500 wrote:
comp500 wrote:
The second one isn't in panther or scratch, just byob.
we know.
you don't have to quote yourself 3 times.
Offline
here is the case sensitive equals boolean.
spec:
('%s is %s' #b #case:sensitive:)
method:
case: t1 sensitive: t2 t1 = t2 ifTrue: [^ true]. ^ false
SO simple
Last edited by scimonster (2011-01-09 01:01:24)
Offline
here is the an is lowercase boolean.
spec:
('%s is lowercase' #b #isLowercase:)
method:
isLowercase: t1
t1 = '' ifTrue: [^ false].
t1 = t1 asLowercase ifTrue: [^ true].
^ false
Offline
uppercase boolean:
spec:
('%s is uppercase' #b #isUppercase:)
method:
isUppercase: t1
t1 = '' ifTrue: [^ false].
t1 = t1 asUppercase ifTrue: [^ true].
^ false
Offline
mixed upper/lowercase:
spec:
('%s is mixed upper/lowercase' #b #isMixed:)
method:
isMixed: t1
t1 = t1 asLowercase ifTrue: [^ false].
t1 = t1 asUppercase ifTrue: [^ false].
^ true
Yay! 1111st post!`
Last edited by scimonster (2011-01-06 15:05:40)
Offline
k. I'd like to start getting deeper into squeak. Any tips?
Offline
I've got several BYOB blocks...
And the download file.
Wow, Panther is a great tool for automating stuff (like typing out the images and links) that would normally take an hour!
Last edited by floppy_gunk (2011-01-07 05:19:19)
Offline
Yeah, I use Panther to add large amount of BBcode to my posts at once It's great for that kind of thing. A tip, write the output text to a file, not a list, It's about 10 times faster! Especially if you turn on turbo-speed first!
Offline
my first block! It may not work.
Blockspec:
('alert %s' #- #alert)
code:
alert: t1
t1<-DialogBoxMorph new title: "?" inform: t1.
Does that work?
Offline
ProgrammingFreak wrote:
my first block! It may not work.
Blockspec:
('alert %s' #- #alert:)
code:
alert: t1
t1<-DialogBoxMorph new title: "?" inform: t1.
Does that work?
You need to have a : every area where there is an input.
Offline
bbbeb wrote:
ProgrammingFreak wrote:
my first block! It may not work.
Blockspec:
('alert %s' #- #alert:)
code:
alert: t1
t1<-DialogBoxMorph new title: "?" inform: t1.
Does that work?You need to have a : every area where there is an input.
I do..
Offline
sparks wrote:
Your block Should work except that you used "double speech marks" not 'single speech marks' (apostrophes) for the text '?' which you put as "?"
cool! I like squeak!
Offline
More blocks:
('%n!' #r #factorial:)
factorial: t1 t1 = 0 ifTrue: [^ 1]. ^ (self factorial: t1 - 1) * t1
('freeze Scratch for %n' #- #freeze:)
freeze: t1 t1 = 0 ifTrue: [^self] self freeze: t1-1
Note: the block above does not take the numerical value as seconds (10 would be extremely short. On my Mac, I need 1000 or more to register around 0.01-0.02 secs).
I have made the block [draw a circle with [circumference/diameter] of (10)], but it is laggy and freezes Scratch. Should I still post it?
Offline
comp500 wrote:
sparks wrote:
Yes, sorry comp, they're already in the library but thanks all the same for your contribution
The second one isn't in panther or scratch, just byob.
ADD IT!
Last edited by comp500 (2011-01-07 10:38:27)
Offline