Sweet, that fixed it.
I forgot , 0 at the end of ink, I usually set up an array of possible colors, I'm not used to calling the command seperately from a function.
I have learned so much folrm this challenge alone, can't wait for the possibilities of learning from a new project!
Rem Project: AnalogClock
Rem Created: Saturday, April 02, 2011
Rem ***** Main Source File *****
REM Setting up some global values used to tell the time.
Global thistime$
Global hour$
Global minutes$
Global seconds$
REM Roman numbers are false.
Global Roman = 0
REM Our initial call to set up the time.
gettime$ = " : "
Dim style(2, 4) as string
style(1, 1) = "12"
style(1, 2) = "3"
style(1, 3) = "6"
style(1, 4) = "9"
style(2, 1) = "XII"
style(2, 2) = "III"
style(2, 3) = "VI"
style(2, 4) = "IX"
Dim locx(4) as integer
Dim locy(4) as integer
locx(1) = 320
locx(2) = 425
locx(3) = 320
locx(4) = 215
locy(1) = 125
locy(2) = 230
locy(3) = 340
locy(4) = 230
do
REM Calling our function that get's the time from our system clock.
REM We show that tsep$ can be changed to anything we want.
REM Basically just having some fun here. :)
if leftkey() = 1 then gettime$ = " , " : if leftkey() = 1 then roman = 1
if rightkey() = 1 then gettime$ = " : " : if rightkey() = 1 then roman = 0
if downkey() = 1 then gettime$ = " . "
if upkey() = 1 then gettime$ = " ; "
GetRealTime(gettime$)
REM Clears the screen and set's the text size to 20, used for our digital clock.
cls
set text size 20
REMstart
This section of code colors the hands of the clock.
It then draws each hand in turn and turns the hands by use of
SIN and COS.
REMend
ink rgb(14, 14, 14), 0
box 200, 120, 440, 420
ink rgb(170,0,50),0
center text 320, 380, "Dbn's clock"
line 320,240,320+sin(val(seconds$)*6)*75,240-cos(val(seconds$)*6)*75
ink rgb(200,30,0),0
line 320,240,320+sin(val(minutes$)*6)*75,240-cos(val(minutes$)*6)*75
ink rgb(200,200,200),0
line 320,240,320+sin(val(hour$)*30)*50,240-cos(val(hour$)*30)*50
REM Here we draw the numbers of the clock and then draw a circle that is our
REM clock face.
REM Just added support for roman numerals, leftkey will change it to roman numbers
REM and rightkey will change it to regular numbers.
if roman = 0
center text locx(1), locy(1), style(1, 1)
center text locx(2), locy(2), style(1, 2)
center text locx(3), locy(3), style(1, 3)
center text locx(4), locy(4), style(1, 4)
ENDIF
if roman = 1
center text locx(1), locy(1), style(2, 1)
center text locx(2), locy(2), style(2, 2)
center text locx(3), locy(3), style(2, 3)
center text locx(4), locy(4), style(2, 4)
ENDIF
circle 320, 240, 95
//Drawing the dots that line the circle of our clock.
randomize timer()
for angle = 0 to 360 step 6
ink rgb(rnd(255), rnd(255), rnd(255)), 0
dot 320 + 90 * sin(angle), 240 + 90 * cos(angle)
NEXT angle
REM Here we simply draw our digital clock by using lines, then prints the time
REM inside our boundary.
ink rgb(40, 200, 15), 0
line 45, 45, 150, 45
line 45, 45, 45, 70
line 45, 70, 150, 70
line 150, 45, 150, 70
text 50, 50, thistime$
LOOP
REM tsep$ is the seperator, we could use anything for this.
function GetRealTime(tsep$)
REM get time() is put into a variable that now holds our system time.
time$ = get time$()
REM reads the system time and puts the hour, minute and second into variables
hour$ = left$(time$,2)
minutes$ = mid$(time$,4) + mid$(time$,5)
seconds$ = right$(time$,2)
REM Set's the time value again, this time by putting the other values together
REM and seperating them with tsep$.
time$ = hour$+tsep$+minutes$+tsep$+seconds$
REM Sets a variable for returning from the function.
thistime$=time$
REM we return from the function with thistime$
endfunction thistime$