('distance from x: %n y: %n to x: %n y: %n' #r #dista:n:c:e:)
dista: t1 n: t2 c: t3 e: t4
| t5 t6 t7 t8 t9 t10 |
t5 _ t1 - t3.
t6 _ t5 * t5.
t7 _ t2 - t4.
t8 _ t7 * t7.
t9 _ t8 + t6.
t10 _ t9 sqrt.
^ t10
Last edited by climber59 (2010-03-22 15:11:06)
Offline
Offline
Offline
Here's the code I used to get a time/date block into streak:
First, add this to scratchSpriteMorph class:
('date/time:%t' #r #returnW:)Under scratch-blocks > commandBlockMorph > private > uncoloredArgMorphFor:, add:
$t = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #timeDates;
choice: 'time'].Under scriptableScratchMorph > sensing ops, add this:
timeDates
^ #('time' 'hour' 'minute' 'second' 'date' 'day of month' 'day of year' 'weekday-name' 'weekday-#' 'month-name' 'month-#' 'year' )Finally, under scriptableScratchMorph > sensing ops add this function:
returnW: t1
| time date |
time _ Time now.
date _ Date today.
'time' = t1 ifTrue: [^ time].
'hour' = t1 ifTrue: [^ time hours].
'minute' = t1 ifTrue: [^ time minutes].
'second' = t1 ifTrue: [^ time seconds].
'date' = t1 ifTrue: [^ date].
'weekday-name' = t1 ifTrue: [^ date weekday].
'weekday-#' = t1
ifTrue:
[date weekday = 'Monday' ifTrue: [^ 1].
date weekday = 'Tuesday' ifTrue: [^ 2].
date weekday = 'Wednesday' ifTrue: [^ 3].
date weekday = 'Thursday' ifTrue: [^ 4].
date weekday = 'Friday' ifTrue: [^ 5].
date weekday = 'Saturday' ifTrue: [^ 6].
date weekday = 'Sunday' ifTrue: [^ 7]].
'month-name' = t1 ifTrue: [^ date monthName].
'month-#' = t1 ifTrue: [^ date monthIndex].
'day of month' = t1 ifTrue: [^ date dayOfMonth].
'day of year' = t1 ifTrue: [^ date daysInYear - date daysLeftInYear].
'year' = t1 ifTrue: [^ date year].
^ 0After all of this, you should have a shiny new date/time block!
Just be glad that I made the code; you just have to copy it!
You can also see these projects of mine to get two more:
[open Browser with URL []]
(if<>then[]else[]).
Last edited by billyedward (2010-03-22 18:12:56)
Offline
Somebody please post an image with all of these
Offline
billyedward wrote:
Here's the code I used to get a time/date block into streak:
First, add this to scratchSpriteMorph class:Code:
('date/time:%t' #r #returnW:)Under scratch-blocks > commandBlockMorph > private > uncoloredArgMorphFor:, add:
Code:
$t = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #timeDates; choice: 'time'].Under scriptableScratchMorph > sensing ops, add this:
Code:
timeDates ^ #('time' 'hour' 'minute' 'second' 'date' 'day of month' 'day of year' 'weekday-name' 'weekday-#' 'month-name' 'month-#' 'year' )Finally, under scriptableScratchMorph > sensing ops add this function:
Code:
returnW: t1 | time date | time _ Time now. date _ Date today. 'time' = t1 ifTrue: [^ time]. 'hour' = t1 ifTrue: [^ time hours]. 'minute' = t1 ifTrue: [^ time minutes]. 'second' = t1 ifTrue: [^ time seconds]. 'date' = t1 ifTrue: [^ date]. 'weekday-name' = t1 ifTrue: [^ date weekday]. 'weekday-#' = t1 ifTrue: [date weekday = 'Monday' ifTrue: [^ 1]. date weekday = 'Tuesday' ifTrue: [^ 2]. date weekday = 'Wednesday' ifTrue: [^ 3]. date weekday = 'Thursday' ifTrue: [^ 4]. date weekday = 'Friday' ifTrue: [^ 5]. date weekday = 'Saturday' ifTrue: [^ 6]. date weekday = 'Sunday' ifTrue: [^ 7]]. 'month-name' = t1 ifTrue: [^ date monthName]. 'month-#' = t1 ifTrue: [^ date monthIndex]. 'day of month' = t1 ifTrue: [^ date dayOfMonth]. 'day of year' = t1 ifTrue: [^ date daysInYear - date daysLeftInYear]. 'year' = t1 ifTrue: [^ date year]. ^ 0After all of this, you should have a shiny new date/time block!
Just be glad that I made the code; you just have to copy it!
You can also see these projects of mine to get two more:
[open Browser with URL []]
(if<>then[]else[]).
Can you please post screen shots?
Offline
For The <hidden?> Block, Go To Scratch-Objects Then ScratchSpriteMorph Then Blockspecs Then Blockspecs Again. Now Just Before Sensing, Type:
('hidden?' #b #isHidden)And Then Press Alt+s And You Should Now Have The <hidden?> Block Under The Looks Section!
Offline
No Problem. I Appriciate Your Thanks.
Last edited by TheGameMaster1231 (2010-03-29 08:24:26)
Offline
lol try using the delete block on the stage
Offline
johnnydean1 wrote:
lol try using the delete block on the stage
![]()
WHOA!
Offline
johnnydean1 wrote:
lol try using the delete block on the stage
![]()
If You Did That, You Have Just Gotton Pwnzed. XD
Offline
billyedward wrote:
Here's the code I used to get a time/date block into streak:
First, add this to scratchSpriteMorph class:Code:
('date/time:%t' #r #returnW:)Under scratch-blocks > commandBlockMorph > private > uncoloredArgMorphFor:, add:
Code:
$t = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #timeDates; choice: 'time'].Under scriptableScratchMorph > sensing ops, add this:
Code:
timeDates ^ #('time' 'hour' 'minute' 'second' 'date' 'day of month' 'day of year' 'weekday-name' 'weekday-#' 'month-name' 'month-#' 'year' )Finally, under scriptableScratchMorph > sensing ops add this function:
Code:
returnW: t1 | time date | time _ Time now. date _ Date today. 'time' = t1 ifTrue: [^ time]. 'hour' = t1 ifTrue: [^ time hours]. 'minute' = t1 ifTrue: [^ time minutes]. 'second' = t1 ifTrue: [^ time seconds]. 'date' = t1 ifTrue: [^ date]. 'weekday-name' = t1 ifTrue: [^ date weekday]. 'weekday-#' = t1 ifTrue: [date weekday = 'Monday' ifTrue: [^ 1]. date weekday = 'Tuesday' ifTrue: [^ 2]. date weekday = 'Wednesday' ifTrue: [^ 3]. date weekday = 'Thursday' ifTrue: [^ 4]. date weekday = 'Friday' ifTrue: [^ 5]. date weekday = 'Saturday' ifTrue: [^ 6]. date weekday = 'Sunday' ifTrue: [^ 7]]. 'month-name' = t1 ifTrue: [^ date monthName]. 'month-#' = t1 ifTrue: [^ date monthIndex]. 'day of month' = t1 ifTrue: [^ date dayOfMonth]. 'day of year' = t1 ifTrue: [^ date daysInYear - date daysLeftInYear]. 'year' = t1 ifTrue: [^ date year]. ^ 0After all of this, you should have a shiny new date/time block!
Just be glad that I made the code; you just have to copy it!
You can also see these projects of mine to get two more:
[open Browser with URL []]
(if<>then[]else[]).
doesn't work
Offline
midnightleopard wrote:
billyedward wrote:
Here's the code I used to get a time/date block into streak:
First, add this to scratchSpriteMorph class:Code:
('date/time:%t' #r #returnW:)Under scratch-blocks > commandBlockMorph > private > uncoloredArgMorphFor:, add:
Code:
$t = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #timeDates; choice: 'time'].Under scriptableScratchMorph > sensing ops, add this:
Code:
timeDates ^ #('time' 'hour' 'minute' 'second' 'date' 'day of month' 'day of year' 'weekday-name' 'weekday-#' 'month-name' 'month-#' 'year' )Finally, under scriptableScratchMorph > sensing ops add this function:
Code:
returnW: t1 | time date | time _ Time now. date _ Date today. 'time' = t1 ifTrue: [^ time]. 'hour' = t1 ifTrue: [^ time hours]. 'minute' = t1 ifTrue: [^ time minutes]. 'second' = t1 ifTrue: [^ time seconds]. 'date' = t1 ifTrue: [^ date]. 'weekday-name' = t1 ifTrue: [^ date weekday]. 'weekday-#' = t1 ifTrue: [date weekday = 'Monday' ifTrue: [^ 1]. date weekday = 'Tuesday' ifTrue: [^ 2]. date weekday = 'Wednesday' ifTrue: [^ 3]. date weekday = 'Thursday' ifTrue: [^ 4]. date weekday = 'Friday' ifTrue: [^ 5]. date weekday = 'Saturday' ifTrue: [^ 6]. date weekday = 'Sunday' ifTrue: [^ 7]]. 'month-name' = t1 ifTrue: [^ date monthName]. 'month-#' = t1 ifTrue: [^ date monthIndex]. 'day of month' = t1 ifTrue: [^ date dayOfMonth]. 'day of year' = t1 ifTrue: [^ date daysInYear - date daysLeftInYear]. 'year' = t1 ifTrue: [^ date year]. ^ 0After all of this, you should have a shiny new date/time block!
Just be glad that I made the code; you just have to copy it!
You can also see these projects of mine to get two more:
[open Browser with URL []]
(if<>then[]else[]).doesn't work
It Does Work. You Have Simply Made A Mistake. You Can Just Copy And Paste It You Know.
Offline