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

Username:   Password: 
 RegisterRegister   
 Menu screen help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
koolkid98




PostPosted: Sun Jun 04, 2006 12:32 pm   Post subject: Menu screen help

i made a trivia program and i want a menu screen(using Gui.buttonfull) for the topics but i cant put a procedure for a whole section of the trivia. please help
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sun Jun 04, 2006 12:43 pm   Post subject: Re: Menu screen help

koolkid98 wrote:
i cant put a procedure for a whole section of the trivia. please help

Why not?
koolkid98




PostPosted: Sun Jun 04, 2006 12:52 pm   Post subject: (No subject)

it says that procedures can be only called at the module level
Mr. T




PostPosted: Sun Jun 04, 2006 12:58 pm   Post subject: Alex's Opinion

Maybe it would be best to posted some code so we can see what you're trying to accomplish.
Mr. T




PostPosted: Sun Jun 04, 2006 1:15 pm   Post subject: Alex's Opinion

mod edit: Removed enormous triple post just above this post. See below for the code.

1. Gah, huge double post.
2. Mind including the pics so ppl can run the program?
koolkid98




PostPosted: Sun Jun 04, 2006 1:16 pm   Post subject: (No subject)

ok heres part of it, i want to make a button so that when a user clicks it, the this part of the trivia pops up
code:

import GUI
var finished, finished2, finished3, finished4, finished5, finished6, finished7, finished8 : boolean := false
var music : string
var point : int
var song, song2, song3, song4, song5, song6, song7, song8 : int
var chars : array char of boolean
var p1point : int := 0
var p2point : int := 0
var name1 : string
var name2 : string
var pic : int
var font : int
font := Font.New ("timesnewroman:12")

procedure picture ()
    pic := Pic.FileNew ("50-cent-wallpapers-1024.jpg")
    Pic.Draw (pic, 1, 1, picCopy)
    Pic.Free (pic)
end picture
picture
Font.Draw ("Hi, May I have two first names please", 1, 388, font, black)
locate(2,1)
get name1
locate(3,1)
get name2
put "Welcome to Music trivia please enjoy the game ", name1, " and ", name2
delay (3000)
cls
procedure picture1 ()
    pic := Pic.FileNew ("Center-sign-music.jpg")
    Pic.Draw (pic, 1, 1, picCopy)
    Pic.Free (pic)
end picture1
picture1

Font.Draw ("This is a two player Trivia,the person who answers the most questions correctly wins.",1,388,font,black)
locate(4,1)
Font.Draw ("The buzzer buttons are z and m",1,370,font,black)
locate(4,1)
put "The buzzer button for you,", name1, " is z"
locate(6,1)
put "And the buzzer button for you,", name2, " is m"

Font.Draw ("What song is currently playing? (press your buzzer key if you know)",1,265,font,black)
Font.Draw ("1)Bitter Sweet Sympthony: by the Verve",1,250,font,black)

Font.Draw ("2)Into the Sea: by Dj Dean",1,235,font,black)

Font.Draw ("3)Mind Made up: by Tupac",1,220,font,black)

Font.Draw ("4)Sweet Day: by orangville",1,205,font,black)
process a
    loop
        Music.PlayFile ("The Verve - Bittersweet Symphony.mp3")
        exit when finished
    end loop
end a
fork a

    loop
        Input.KeyDown (chars)
        if chars ('z') then
locate (14,1)
            put "what song is currently playing ", name1, "(1,2,3 or 4)"
            song := 1
locate(15,1)
            get song
            if song = 1 then

                put "you got it correct"
                p1point := p1point + 1
                finished := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if



        elsif chars ('m') then
            song := 1
            put "what song is currently playing ", name2, "(1,2,3 or 4)"
            locate(14,1)
            get song
            if song = 1 then
                put " you got it correct"
                p2point := p2point + 1
                finished := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put "that is incorrect,sorry"
                finished := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if
            cls
            delay(3000)
           
        end if
        exit when finished

    end loop




process b
    loop
        Music.PlayFile ("Avenged Sevenfold   Second Heartbeat.mp3")
        exit when finished2
    end loop
end b




    fork b
    put "What song is currently playing? (press your buzzer key if you know)"
    put " "
    put "1)Prisoners of Today - Billy Talent"
    put "2)Tears dont fall - Bullet for my Valentine"
    put "3)Disaster - New Found Glory"
    put "4)Second Heartbeat - Avenged Sevenfold"
    loop

        Input.KeyDown (chars)
        if chars ('z') then



            put "what song is currently playing ", name1, "(1,2,3 or 4)"
            song2 := 4

            get song2
            if song2 = 4 then

                put "you got it correct"
                p1point := p1point + 1
                finished2 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished2 := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if
            cls



        elsif chars ('m') then
            song2 := 4
            put "what song is currently playing ",name2," (1,2,3 or 4)"
            get song2
            if song2 = 4 then
                put " you got it correct"
                p2point := p2point + 1
                finished2 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished2 := true
                Music.PlayFileStop

                delay (1000)

                cls
            end if
            cls

        end if
        exit when finished2


    end loop


process c
    loop
        Music.PlayFile ("newfound glory - This Disaster.mp3")
        exit when finished3
    end loop
end c





    fork c
    put "What song is currently playing? (press your buzzer key if you know)"
    put " "
    put "1)Streets that Light - Dj Whirl"
    put "2)All the Small Things - Blink 182"
    put "3)Dig - Mudvayne"
    put "4)Disaster - Newfound Glory"
    loop

        Input.KeyDown (chars)
        if chars ('z') then



            put "what song is currently playing ",name1,"(1,2,3 or 4)"
            song3 := 4

            get song3
            if song3 = 4 then

                put "you got it correct"
                p1point := p1point + 1
                finished3 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished3 := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if
            cls



        elsif chars ('m') then
            song3 := 4
            put "what song is currently playing ",name2,"(1,2,3 or 4)"
            get song3
            if song3 = 4 then
                put " you got it correct"
                p2point := p2point + 1
                finished3 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished3 := true
                Music.PlayFileStop

                delay (1000)

                cls
            end if
            cls

        end if
        exit when finished3


    end loop


process d
    loop
        Music.PlayFile ("Dj_Whirl-Streets_at_Night.mp3")
        exit when finished4
    end loop
end d





    fork d
    put "What song is currently playing? (press your buzzer key if you know)"
    put " "
    put "1)Streets At Night - Dj Whirl "
    put "2)Forbidden Paradise - Dj Tiesto"
    put "3)Miracle - Cascada"
    put "4)So Irresistable - DJ Splash"
    loop

        Input.KeyDown (chars)
        if chars ('z') then



            put "what song is currently playing ",name1," (1,2,3 or 4)"
            song4 := 1

            get song4
            if song4 = 1 then

                put "you got it correct"
                p1point := p1point + 1
                finished4 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished4 := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if
            cls



        elsif chars ('m') then
            song4 := 4
            put "what song is currently playing ",name2," (1,2,3 or 4)"
            get song4
            if song4 = 4 then
                put " you got it correct"
                p2point := p2point + 1
                finished4 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished4 := true
                Music.PlayFileStop

                delay (1000)

                cls
            end if
            cls

        end if
        exit when finished4


    end loop




process e
    loop
        Music.PlayFile ("rap--Scarface - On My Block.mp3")
        exit when finished5
    end loop
end e





    fork e
    put "What song is currently playing? (press your buzzer key if you know)"
    put " "
    put "1)Smile - Scarface feat Tupac "
    put "2)My Block - Scarface"
    put "3)The Documentry- The Game"
    put "4)Who is 50 cent - Wu Tang Clan"
    loop

        Input.KeyDown (chars)
        if chars ('z') then



            put "what song is currently playing ",name1," (1,2,3 or 4)"
            song5 := 2

            get song5
            if song5 = 2 then

                put "you got it correct"
                p1point := p1point + 1
                finished5 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished5 := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if
            cls



        elsif chars ('m') then
            song5 := 2
            put "what song is currently playing ",name2,"(1,2,3 or 4)"
            get song5
            if song5 = 2 then
                put " you got it correct"
                p2point := p2point + 1
                finished5 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished5 := true
                Music.PlayFileStop

                delay (1000)

                cls
            end if
            cls

        end if
        exit when finished5


    end loop


process f
    loop
        Music.PlayFile ("Jay-Z_ft_Linkin_Park--Numb_Encore.mp3")
        exit when finished6
    end loop
end f





    fork f
    put "What song is currently playing? (press your buzzer key if you know)"
    put " "
    put "1)In The End - Linkin Park "
    put "2)Numb Encore - Jay Z & Linkin Park"
    put "3)Bang Bang - Rammstein"
    put "4)Cleaning Out My Closet - Eminem"
    loop

        Input.KeyDown (chars)
        if chars ('z') then



            put "what song is currently playing ",name1," (1,2,3 or 4)"
            song6 := 2

            get song6
            if song6 = 2 then

                put "you got it correct"
                p1point := p1point + 1
                finished6 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished6 := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if
            cls



        elsif chars ('m') then
            song6 := 2
            put "what song is currently playing ",name2," (1,2,3 or 4)"
            get song6
            if song6 = 2 then
                put " you got it correct"
                p2point := p2point + 1
                finished6 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished6 := true
                Music.PlayFileStop

                delay (1000)

                cls
            end if
            cls

        end if
        exit when finished6


    end loop


process g
    loop
        Music.PlayFile ("Franz_Ferdanad-Take_Me_Out.mp3")
        exit when finished7
    end loop
end g




    fork g
    put "What song is currently playing? (press your buzzer key if you know)"
    put " "
    put "1)Photograph - NickleBack "
    put "2)WonderWall - Oasis"
    put "3)Take Me Out - Franz Ferdinand"
    put "4)Smile Like You Mean It - The Killers"
    loop

        Input.KeyDown (chars)
        if chars ('z') then



            put "what song is currently playing ", name1, "(1,2,3 or 4)"
            song7 := 3

            get song7
            if song7 = 3 then

                put "you got it correct"
                p1point := p1point + 1
                finished7 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished7 := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if
            cls



        elsif chars ('m') then
            song7 := 3
            put "what song is currently playing ", name2, " (1,2,3 or 4)"
            get song7
            if song7 = 3 then
                put " you got it correct"
                p2point := p2point + 1
                finished7 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished7 := true
                Music.PlayFileStop

                delay (1000)

                cls
            end if
            cls

        end if
        exit when finished7


    end loop

process h
    loop
        Music.PlayFile ("T.I. -What You Know About That-dirty.mp3")
        exit when finished8
    end loop
end h





    fork h
    put "What song is currently playing? (press your buzzer key if you know)"
    put " "
    put "1)Rappers Delight - Super Hill Gang"
    put "2)What You Know About That T.I"
    put "3)Notorious Thugz - Bone Thugs And Harmony"
    put "4)Regulators - Warren G"
    loop

        Input.KeyDown (chars)
        if chars ('z') then



            put "what song is currently playing ", name1, "(1,2,3 or 4)"
            song8 := 2

            get song8
            if song8 = 2 then

                put "you got it correct"
                p1point := p1point + 1
                finished8 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished8 := true
                Music.PlayFileStop
                delay (1000)
                cls
            end if
            cls



        elsif chars ('m') then
            song8 := 2
            put "what song is currently playing ", name2, " (1,2,3 or 4)"
            get song8
            if song8 = 2 then
                put " you got it correct"
                p2point := p2point + 1
                finished8 := true
                Music.PlayFileStop
                delay (1000)
                cls
            else
                put " that is incorrect,sorry"
                finished8 := true
                Music.PlayFileStop

                delay (1000)

                cls
            end if
            cls

        end if
        exit when finished8


    end loop

procedure points
    if p1point > p2point then
        put "congratulations,", name1, " you've won with ", p1point, " points"
    elsif p1point < p2point then
        put "congratulations,", name2, " you've won with ", p2point, " points"
    else
        put "tie game!"
    end if
end points
points
koolkid98




PostPosted: Sun Jun 04, 2006 5:21 pm   Post subject: (No subject)

if you want to run it just delete the picture parts, please help i got to finish this in 2 days
Mr. T




PostPosted: Sun Jun 04, 2006 5:57 pm   Post subject: Alex's Opinion

When I take out the pics, the program seems to run fine for me.
Sponsor
Sponsor
Sponsor
sponsor
Guest




PostPosted: Sun Jun 04, 2006 6:05 pm   Post subject: (No subject)

It works fine for me.
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 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: