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

Username:   Password: 
 RegisterRegister   
 New program by Robbie
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
upthescale




PostPosted: Wed Mar 29, 2006 2:19 pm   Post subject: New program by Robbie

...
Sponsor
Sponsor
Sponsor
sponsor
upthescale




PostPosted: Wed Mar 29, 2006 2:58 pm   Post subject: (No subject)

sorry this is it


code:

var x, y, x2, y2, button2, life : int
life := 3
%Procedures
proc bounds
    if x2 < 0 then
        put "You left the area!"
        delay (1000)
        break
    end if
    if x2 > 800 then
        put "You left the area!"
        delay (1000)
        break
    end if
    if y2 < 0 then
        put "You left the area!"
        delay (1000)
        break
    end if
    if y2 > 452 then
        put "You left the area!"
        delay (1000)
        break
    end if
end bounds
%Procedures
put "Life= ", life
%Procedures
proc level
    put "Level Up!"
    delay (900)
    cls
end level
%Procedures
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%The Game
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%The Game
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%The Game
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%The Game
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%The Game
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%The Game
%%%%%New Level
proc yoo
    x := 300
    y := 400
    loop
        drawfillbox (x, y, x + 50, y + 50, 7)
        delay (30)
        drawfillbox (x, y, x + 50, y + 50, 0)
        y := y - 7
        exit when y < -40
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 50 and y2 >= y and y2 <= y + 50 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        bounds
    end loop
    %%%%%New Level
    x := 80
    y := 400
    loop
        drawfillbox (x, y, x + 50, y + 50, 7)
        delay (30)
        drawfillbox (x, y, x + 50, y + 50, 0)
        y := y - 7
        exit when y < -40
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 50 and y2 >= y and y2 <= y + 50 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        bounds
    end loop
    %%%%%New Level
    x := 80
    y := 400
    loop
        drawfillbox (x, y, x + 700, y + 50, 7)
        delay (30)
        drawfillbox (x, y, x + 700, y + 50, 0)
        y := y - 7
        exit when y < -40
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 700 and y2 >= y and y2 <= y + 50 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        bounds
    end loop
    %%%%%New Level
    x := 80
    y := 220
    loop
        drawfillbox (x, y, x + 300, y + 300, 7)
        delay (30)
        drawfillbox (x, y, x + 300, y + 300, 0)
        y := y - 7
        exit when y < -320
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 300 and y2 >= y and y2 <= y + 300 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit

        end if
        if life <= 0 then
            put "You lose!"
            delay (900)
            break
        end if
        bounds
    end loop
    level
    %%%%%New Level
    put "Life= ", life
    x := 80
    y := 400
    loop
        drawfillbox (x, y, x + 700, y + 50, 7)
        delay (30)
        drawfillbox (x, y, x + 700, y + 50, 0)
        y := y - 9
        exit when y < -40
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 700 and y2 >= y and y2 <= y + 700 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (900)
            break
        end if
        bounds
    end loop
    %%%%%New Level
    x := 80
    y := -500
    loop
        drawfillbox (x, y, x + 700, y + 344, 7)
        delay (30)
        drawfillbox (x, y, x + 700, y + 344, 0)
        y := y + 9
        exit when y > 500
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 700 and y2 >= y and y2 <= y + 344 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
        bounds
    end loop
    %%%%%New Level
    x := 400
    y := -10
    loop
        drawfillbox (x, y, x + 700, y + 440, 7)
        delay (30)
        drawfillbox (x, y, x + 700, y + 440, 0)
        x := x - 9
        exit when x < -800
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 700 and y2 >= y and y2 <= y + 440 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
        bounds
    end loop
    %%%%%New Level
    x := 808
    y := 420
    loop
        drawfillbox (x, y, x + 300, y + 300, 7)
        delay (30)
        drawfillbox (x, y, x + 300, y + 300, 0)
        y := y - 7
        x := x - 7
        exit when y < -320
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 300 and y2 >= y and y2 <= y + 300 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
        bounds
    end loop
    level
    %%%%%New Level
    put "Life= ", life
    x := 400
    y := 10
    loop
        drawfillbox (x, y, x + 34, y + 233, 7)
        delay (30)
        drawfillbox (x, y, x + 34, y + 233, 0)
        x := x - 16
        exit when x < 0
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 34 and y2 >= y and y2 <= y + 233 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
        bounds
    end loop
    %%%%%New Level
    x := 0
    y := 10
    loop
        drawfillbox (x, y, x + 34, y + 233, 7)
        delay (30)
        drawfillbox (x, y, x + 34, y + 233, 0)
        x := x + 16
        exit when x > 860
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 34 and y2 >= y and y2 <= y + 233 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        bounds
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
    end loop
    %%%%%New Level
    x := 900
    y := 10
    loop
        drawfillbox (x, y, x + 122, y + 233, 7)
        delay (30)
        drawfillbox (x, y, x + 122, y + 233, 0)
        x := x - 22
        exit when x < 0
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 122 and y2 >= y and y2 <= y + 233 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        bounds
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
    end loop
    %%%%%New Level
    x := 100
    y := 600
    loop
        drawfillbox (x, y, x + 400, y + 500, 7)
        delay (30)
        drawfillbox (x, y, x + 400, y + 500, 0)
        y := y - 16
        exit when y < -500
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 400 and y2 >= y and y2 <= y + 500 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
        bounds
    end loop
    %%%%%New Level
    level
    put "Life= ", life
    x := 600
    y := 20
    loop
        drawfillbox (x, y, x + 600, y + 400, 7)
        delay (30)
        drawfillbox (x, y, x + 600, y + 400, 0)
        x := x - 22
        exit when x < -580
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 600 and y2 >= y and y2 <= y + 400 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
        bounds
    end loop
    %%%%%New Level
    x := 0
    y := 500
    loop
        drawfillbox (x, y, x + 740, y + 500, 7)
        delay (30)
        drawfillbox (x, y, x + 740, y + 500, 0)
        y := y - 22
        exit when y < -500
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 740 and y2 >= y and y2 <= y + 500 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
        bounds
    end loop
    %%%%%New Level
    put "life= ", life
    x := 100
    y := 500
    loop
        drawfillbox (x, y, x + 500, y + 300, 7)
        delay (30)
        drawfillbox (x, y, x + 500, y + 300, 0)
        y := y - 26
        exit when y < -500
        mousewhere (x2, y2, button2)
        if x2 >= x and x2 <= x + 740 and y2 >= y and y2 <= y + 300 then
            cls
            life := life - 1
            put "Life= ", life
            delay (900)
            exit
        end if
        if life <= 0 then
            put "You lose!"
            delay (1200)
            break
        end if
        bounds
    end loop
    %%%%%New Level
    put "Congratualtions, you have won!"
end yoo
var number, number2, answer, score : int
var ch : string (1)
var x4, y4, x5, y5, button, chances : int
var answer2 : string
chances := 4
x4 := 0
score := 0
proc yo
    put "You lose the whole game!"
    delay (2200)
    cls
    break
end yo
proc hey
    loop
        mousewhere (x5, y5, button)
        %if x2 >= x and x2 <= x + 50 and y2 >= y and y2 <= y + 50 then
        if x5 >= x4 and x5 <= x4 + 70 and y5 >= 10 and y5 <= 56 and button = 1 then
            put "Good!"
            delay (1200)
            cls
            exit
        elsif button = 1 then
            chances := chances - 1
            put "Wrong! You have ", chances, " left"
            delay (900)
            if chances = 0 then
                yo
            end if
        end if
    end loop
end hey
randomize
randint (number, 1, 10)
randint (number2, 1, 10)
cls
put "What is ", number, " times ", number2
get answer
if answer = number * number2 then
    score := score + 1
    put "Good! Your score is, ", score
else
    score := score - 1
    put "wrong! Your score is, ", score
end if
put ""
put "Now ", number, " * ", number2, " was ", number * number2
put ""
delay (2200)
put "What is ", number * number2, " - ", number, ""
get answer
if answer = number * number2 - number then
    score := score + 1
    put "Good! Your score is, ", score
else
    score := score - 1
    put "wrong! Your score is, ", score
    delay (1200)
end if
put ""
put "Ok, this is getting boring...Let's move on!"
put ""
put "Hit a key to continue"
getch (ch)
cls
put "Your score before was ", score
if score > 1 then
    put "That's to easy, let's get hard!"
    delay (2200)
    cls
else
    put "Wow, oh well let's hope you do well in the next session"
    delay (3200)
    cls
end if
put "The box will move across the grey...then when it gets to the end,"
put "the grey will go black. Your job is to find where the square is"
put "in that black area. You have four chances to click and find it!"
put ""
getch (ch)
cls
for g : 1 .. 210
    drawfillbox (x4, 10, x4 + 70, 56, 7)
    delay (10)
    drawfillbox (x4, 10, x4 + 70, 56, 0)
    x4 := x4 + 2
    drawfillbox (10, 10, 500, 56, 23)
end for
drawfillbox (10, 10, 500, 56, 7)
randint (x4, 0, 500)
drawfillbox (x4, 10, x4 + 70, 56, 7)
hey
put "Ok, good you got the square with ", chances, " chances left"
delay (3300)
cls
put "Now was that difficult?"
get answer2
cls
if answer2 = "y" or answer2 = "ya" or answer2 = "yes" then
    put "Well...Things will get a little more trickier..."
    put ""
    getch (ch)
    cls
else
    put "Ok, well stick with me, things will get harder!"
    put ""
    getch (ch)
    cls
end if
put "For this game, just dodge those squares!"
put ""
getch (ch)
cls
yoo
do_pete




PostPosted: Wed Mar 29, 2006 3:42 pm   Post subject: (No subject)

You could've just edited your previous post instead of posting it twice.
upthescale




PostPosted: Wed Mar 29, 2006 4:21 pm   Post subject: (No subject)

yeah i know, i go on skatersinc.com and i can edit it there but i don't know how here
cool dude




PostPosted: Wed Mar 29, 2006 4:29 pm   Post subject: (No subject)

k some negative comments because u said u want them lol. firstly that takes 500 + lines to write? Confused aside from that u got to error proof!!! also i don't like the breaks whenever i go outside of the screen instead u could just take away a life. also at one point there is a huge black brick that comes and u can't dodge it so u lose the game.

EDIT: don't post 500 lines of code just attach it!
upthescale




PostPosted: Wed Mar 29, 2006 7:58 pm   Post subject: (No subject)

it werks on my computer, but the setscren iss off so that is why u lose
MysticVegeta




PostPosted: Thu Mar 30, 2006 3:11 pm   Post subject: (No subject)

You do realize that the default screen size is same for every computer right? Also, cool_dude is right, you cannot dodge the huge box that comes, the breaks are annoying, the math game in the beginning is annoying and I am sure less delay would do good, less comments in between would do good and thats basically about it. Oh and this could easily be written in around 60-70 lines. If you need to see how its done, just ask me here and I will try to reduce the size.
cool dude




PostPosted: Thu Mar 30, 2006 7:39 pm   Post subject: (No subject)

hahaha mystic and his short code! u suprise me at times how u can shorten the code down. good job i look up to u lol.
Sponsor
Sponsor
Sponsor
sponsor
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  [ 8 Posts ]
Jump to:   


Style:  
Search: