Sparks, maybe you could do it.
I'll add it after I vote on the elections.
Offline
Please, will someone add the following two lines to my (factorial of %n) block, right after the | answer t1store | ?
t1 isInf ifTrue:[^0]. t1 isNaN ifTrue:[^0].
The reason is that if t1 = Infinity Scratch will freeze, and I don't want to risk it with NaNs.
Last edited by Greenatic (2011-07-21 11:51:28)
Offline
Yes.
I won't be able to do an update until tomorrow.
Offline
This is a bit embarrassing...
Meowmeow55, where is your BYOB sprite uploader?
Offline
sparks wrote:
here. Luckily it's in my history You'll need to log in though!
Offline
It kept logging me out when I put it in the URL bar!
Offline
scimonster wrote:
It kept logging me out when I put it in the URL bar!
It probably has something to do with the session IDs that phpBB uses...Try wandering around the forums for a bit, then going to the page. Or maybe your browser is using a cached copy?
Offline
sparks wrote:
the elections! I'm so nervous and excited! ... exervous? nervexited?
I voted for you... you deserve it!
Offline
I have a block, but it is having a fit about the double ifTrue:'s. So if anyone can help, Thanks.
First, make a new dropdown (for %Y) with choice of 'Infinite', and the menu should contain 'Infinite', 'Not a Number', and 'Too Small'.
('%s is %Y' #b #not: 'string' Number:)
not:t1Number:t2 t2 = 'Infinite' ifTrue: [t1 isInf ifTrue: [^true]]. t2 = 'Not a Number' ifTrue: [t1 isNan ifTrue: [^true]]. t2 = 'Too Small' ifTrue: [t1 isNil ifTrue: [^true]]. ^false
Last edited by TuragaTreeko (2011-07-22 09:23:16)
Offline
TuragaTreeko wrote:
I have a block, but it is having a fit about the double ifTrue:'s. So if anyone can help, Thanks.
Code:
First, make a new dropdown (for %Y) with choice of 'Infinite', and the menu should contain 'Infinite', 'Not a Number', and 'Too Small'.Code:
('%s is %Y' #b #not: 'string' Number:)Code:
not:t1Number:t2 t2 = 'Infinite' ifTrue: [t1 isInf ifTrue: [^true]]. t2 = 'Not a Number' ifTrue: [t1 isNan ifTrue: [^true]]. t2 = 'Too Small' ifTrue: [t1 isNil ifTrue: [^true]]. ^false
I think you're supposed to use ifNaN, not ifNan. Maybe that's messing it up.
Offline
Block request: (for panther)
delete costume [costume1]
delete background [background1]
This would be particularly useful when deleting costumes, backgrounds that you added using the save stage to background block.a motto too.
Last edited by LiquidMetal (2011-07-22 11:34:25)
Offline
Greenatic wrote:
TuragaTreeko wrote:
I have a block, but it is having a fit about the double ifTrue:'s. So if anyone can help, Thanks.
Code:
First, make a new dropdown (for %Y) with choice of 'Infinite', and the menu should contain 'Infinite', 'Not a Number', and 'Too Small'.Code:
('%s is %Y' #b #not: 'string' Number:)Code:
not:t1Number:t2 t2 = 'Infinite' ifTrue: [t1 isInf ifTrue: [^true]]. t2 = 'Not a Number' ifTrue: [t1 isNan ifTrue: [^true]]. t2 = 'Too Small' ifTrue: [t1 isNil ifTrue: [^true]]. ^falseI think you're supposed to use ifNaN, not ifNan. Maybe that's messing it up.
Forgot a couple periods.
Offline
I'm not sure whether this is the right place to put it, but how about a (repition no.) variable block so for example you have a repeat (7) block and it tells you how many times it's repeated so far.
Offline
RUMCHEERYPOOPOO wrote:
I'm not sure whether this is the right place to put it, but how about a (repition no.) variable block so for example you have a repeat (7) block and it tells you how many times it's repeated so far.
hmm, this would certainly save making a counting variable but I think that to link the reporter to a certain repeats loop wouldn't be possible without heavily editing Scratch...
Offline
poemon1 wrote:
('pi' #r #pi)
Code:
pi ^ 3.14159265('pi^2' #r #piRaisedToTwo)
Code:
piRaisedToTwo ^ 3.14159265 raisedTo: 2
Both of these can be acheived through other blocks.
Offline
scimonster wrote:
Greenatic wrote:
TuragaTreeko wrote:
I have a block, but it is having a fit about the double ifTrue:'s. So if anyone can help, Thanks.
Code:
First, make a new dropdown (for %Y) with choice of 'Infinite', and the menu should contain 'Infinite', 'Not a Number', and 'Too Small'.Code:
('%s is %Y' #b #not: 'string' Number:)Code:
not:t1Number:t2 t2 = 'Infinite' ifTrue: [t1 isInf ifTrue: [^true]]. t2 = 'Not a Number' ifTrue: [t1 isNan ifTrue: [^true]]. t2 = 'Too Small' ifTrue: [t1 isNil ifTrue: [^true]]. ^falseI think you're supposed to use ifNaN, not ifNan. Maybe that's messing it up.
Forgot a couple periods.
Oh, where?
Offline
TuragaTreeko wrote:
scimonster wrote:
TuragaTreeko wrote:
HEY! THAT WAS MY BLOCK! Oh, btw, it should be
objName_t1 instead.
Also, does anyone know whyCode:
absoluteValue:t1 [^t1 asPositive]doesn't work for
Code:
('|%n|' #r #absoluteValue: -5)ABS is already an implemented function.
Code:
^t1 absAnd the other code I posted works fine...
Code:
absoluteValue:t1 t1 < 0 ifTrue: [^ t1 * -1]. ^ t1Yeah, sorry bout that, (the abs thing), but I was the one who originally made the open user page and rename page, both work fine, and they haven't been added, and jslomba and poeman1 ended up getting the credit! mad: So, I am not happy.
sorry bout that
Offline
RUMCHEERYPOOPOO wrote:
I'm not sure whether this is the right place to put it, but how about a (repition no.) variable block so for example you have a repeat (7) block and it tells you how many times it's repeated so far.
That's doable in BYOB, but I'm not sure about Scratch.
Offline
poemon1 wrote:
('pi' #r #pi)
Code:
pi ^ 3.14159265('pi^2' #r #piRaisedToTwo)
Code:
piRaisedToTwo ^ 3.14159265 raisedTo: 2
If you want to use Pi, you should use the Float class variable Pi, which is defined as:
Pi = 3.14159265358979323846264338327950288
Offline