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

Username:   Password: 
 RegisterRegister   
 Loop inside a function
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mazer




PostPosted: Mon Dec 01, 2003 9:20 pm   Post subject: (No subject)

aww... but i don't get any bits on msn... hehe. yeah, ncoutsos@hotmail.com
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Mon Dec 01, 2003 9:23 pm   Post subject: (No subject)

here u go nick
code:
var runtime, count, starttime := 0
put "run for how many seconds?"
get runtime
runtime *= 1000

%Declaring variables
var colback, ballcol : int
var x := maxx div 2
var y := maxy div 2

%Procedure
proc circle
    randint (ballcol, 5, 225)
    drawfilloval (x, y, 20, 20, ballcol)
end circle

%Setting screen
setscreen ("nocursor")

%loop statement
loop

    loop

        randint (colback, 5, 50)
        drawfillbox (0, 0, maxx, maxy, colback)
        drawdot (1, -10, (Time.Elapsed mod 255) + 1)
        count := Time.Elapsed div 255
        if (255 * (count + 1)) > runtime then
            if (255 * count) + whatdotcolor (1, -10) - 1 > runtime then
                return
            end if
        end if
        %Exiting from the program
        exit when x < 10 or x > maxx - 10 or y < 10 or y > maxy - 10
        circle
        delay (50)
        drawfilloval (x, y, 20, 20, colback)
        randint (x, x - 15, x + 15)
        randint (y, y - 15, y + 15)
    end loop
    x := maxx div 2
    y := maxy div 2

end loop

Mazer




PostPosted: Mon Dec 01, 2003 9:35 pm   Post subject: (No subject)

my goodness. you truly are the Whatdotcolor Warrior. i'm gonna start a petition to get your name/rank changed accordingly. honestly
Andy




PostPosted: Mon Dec 01, 2003 9:40 pm   Post subject: (No subject)

oops, thats for DBZ's program... damn oh well...
Mazer




PostPosted: Mon Dec 01, 2003 9:42 pm   Post subject: (No subject)

doesn't matter. you're still the WW
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 20 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: