Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Another pointless program... well.. Using Arcs
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
santabruzer




PostPosted: Tue Jan 20, 2004 6:05 pm   Post subject: Another pointless program... well.. Using Arcs

..here it is.. another "pointless" program:
code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clock Program
% By: Santabruzer
% For: Ms. White
% Date: December 2nd, 2003
% Filename: clockmz.t
% Purpose - This program inputs the time the computer is set to
%   the processing is the drawing of the clock and calculating the
%   location of the hands, and the output is handy clock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% ======================== Configuration ======================== %

var background : int := 1 % Set the BackGround Color you want
var whiteorblack : int := 1 % Set 0 for white, any other number
                            %   will be black
var font := Font.New ("verdana:12:bold") % Change the Font

% =============== Do Not Modify Below this Point ================ %

% Setting Screens
setscreen ("graphics:320;320")
setscreen ("offscreenonly")


% Variable Declaration
% --------------------------------------------------------------- %
var timenow, temp, ampm : string
var ox, oy, midx, midy : int
var hours, minutes, seconds : int
var y : int := 160
var x : int := 100

% Intialazation of black and white colors for the whiteorblack
%   variable
var blac := 7
var whit := 0

% Intialazation of the Midway points
midx := round (maxx / 2)
midy := round (maxy / 2)

% Begin Loop
loop
    % Find out the time
    time (timenow)

    % Set hours, minutes and seconds, from the time
    hours := strint (timenow (1 .. 2))
    minutes := strint (timenow (4 .. 5))
    seconds := strint (timenow (7 .. 8))

    % Subtract 60 so that the clock will work clockwise (degrees work
    %   counter-clockwise)
    seconds := 60 - seconds
    minutes := 60 - minutes
    hours := 24 - hours

    % Change clock to AM / PM
    temp := timenow (1 .. 2)
    if strint (temp) > 12 then
        temp := intstr (strint (temp) - 12)
        ampm := "PM"
    else
        ampm := "AM"
    end if

    % Draw Background
    drawfillbox (0, 0, maxx, maxy, background)

    % Decision for white or black
    if whiteorblack = 1 then
        whit := 0
        blac := 7
    elsif whiteorblack = 0 then
        whit := 7
        blac := 0
    end if

    % Drawing of the Clock's Background
    drawfilloval (midx, midy, 150, 150, blac)

    % Drawing of the lines
    drawline (160, 305, 160, 15, whit) % Horizontal
    drawline (305, 160, 15, 160, whit) % Vertical

    % Drawing of covering circle (used to cover lines)
    drawfilloval (midx, midy, 120, 120, blac)

    % Drawing of Outline
    drawoval (midx, midy, 150, 150, whit)

    % Drawing of current digital time (AM/PM)
    Font.Draw (temp + timenow (3 .. 8) + " " + ampm, 119, 80, font, whit)

    % Drawing of clockhands
    drawfillarc (midx, midy, 120, 120, ((seconds) * 6) + 90, ((seconds) * 6 + 1) + 90, 40)
    drawfillarc (midx, midy, 90, 90, ((minutes) * 6) + 90, ((minutes) * 6 + 1) + 90, 26)
    drawfillarc (midx, midy, 65, 65, ((hours) * 30) + 90, ((hours) * 30 + 1) + 90, 8)

    % Drawing axel dot
    drawfilloval (midx, midy, 3, 3, whit)

    % Updating the sequence
    View.Update
    cls
end loop
% ======================== Do Not Modify ======================== %
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Tue Jan 20, 2004 7:00 pm   Post subject: (No subject)

u noe a clock actually doesnt function like that... as the second hand moves, the minute hand and the hour hand moves too...
the_short1




PostPosted: Sat Mar 13, 2004 12:54 pm   Post subject: (No subject)

you call that useless.... i call it SWEET... that llookz great... colors and all... nice job... i will be using that.,.,. turn it on my monitor while i play PS2 so i can see the time... ncie..+BITS
sport




PostPosted: Sat Mar 13, 2004 3:21 pm   Post subject: Clock

Great job! Nice commenting!
Paul




PostPosted: Sat Mar 13, 2004 8:31 pm   Post subject: (No subject)

Yes yes, way to bring up an old topic Very Happy. And since I didn't comment here, I'll say good job also.
But I don't see the point, since I think he's too busy with his girlfriend to be on compsci, he hasn't posted in a while and I don't see him on MSN.
jonos




PostPosted: Sun Mar 14, 2004 11:41 pm   Post subject: (No subject)

thats just sad, he has his whole life before him to get laid, as do I. so i spam instead of plant my seeds.
shorthair




PostPosted: Mon Mar 15, 2004 11:57 am   Post subject: (No subject)

guys , the program got its praises , LET IT DIE , ther eis no need to bring back old posts , thre are enugh new ones to worry about ithout bringing these ones back , if you find yourself bringing them back , YOUR STALKING THE FORUMS TO MUCH , go write ome code and submit
the_short1




PostPosted: Mon Mar 15, 2004 12:20 pm   Post subject: (No subject)

i agree with short.... htat i why i started my download manager and my shooter game...
Mazer




PostPosted: Mon Mar 15, 2004 1:27 pm   Post subject: (No subject)

You agree with shorthair, and yet you are the one who initially brought this back up...
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: