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

Username:   Password: 
 RegisterRegister   
 MILLIONAIRE! [Can any one help make is better ]
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
spike0721




PostPosted: Tue Jun 03, 2008 2:55 pm   Post subject: MILLIONAIRE! [Can any one help make is better ]

Code:
Turing:
colorback (black)
cls
%the var statements
var reply : string (1)
var answer : int
var right_answer,P,R : int
var restart : string
var choicea, choiceb, choicec, choiced, question : string
var elim1, elim2 : int 
var value, valran : int
var name :string
%the title page
color (red)
locate (11, 27)
colorback (101)
put "Welcome to the Gameshow:"
locate (12, 25)
put "WHO WANTS TO BE A MILLIONAIRE!"

delay (500)
color (purple)
locate (2,3)
put"please enter your name"
drawfillbox (200,350,maxx,400,black)
get name:*

%50/50 lifeline
colorback(black) cls
procedure fiftyfifty
    loop
   
        randint (elim1, 1, 4)
        randint (elim2, 1, 4)
        if elim1 = right_answer or elim2 = right_answer then
            put ""
        elsif elim1 = elim2 then
            put ""
        else
            exit
        end if
    end loop
    if elim1 = 1 or elim2 = 1 then
        drawfillbox (1, 50, maxx div 2, 100, 53)
    elsif elim1 = 2 or elim2 = 2 then
        drawfillbox (maxx div 2, 50, maxx, 100, 53)
    elsif elim1 = 3 or elim2 = 3 then
        drawfillbox (1, 1, maxx div 2, 50,53) 
    elsif elim1 = 4 or elim2 = 4 then
        drawfillbox (maxx div 2, 1, maxx, 50, 53)
    end if
    get answer
end fiftyfifty
%phonecall lifeline
procedure phone
    locate (4, 1)
    put "Freind: Hi" ..
    locate (5, 1)
    put "You: *Tells question to friend*" ..
    locate (6, 1)
    randint (valran, 1, 20)
    if valran <= value then
        put "Freind:",name,"I am really not sure, sorry!" ..
    else
        put "Freind: I think the answer ", right_answer ..
    end if
    get answer
end phone
%seeing if the answer is correct
procedure right 
    locate (2, 1)
    if answer = right_answer then
        locate (8, 1)
        put name,"":1, "YOU ARE RIGHT!!!" ..
        locate (9, 1)
        put "Press any key to go to next question" ..
        getch (reply)
    else
        locate (8, 1)
        put "Wrong,Sorry",name,"you lose" ..
        getch (reply)
    end if
end right
procedure format %the game format or where everything is placed
    drawbox (1, 1, maxx, 100, white) % options box
    drawline (maxx div 2, 1, maxx div 2, 100, white)
    drawline (1, 50, maxx, 50, white)
    drawline (1, 180, maxx, 180, white) %box in question
    drawline (maxx div 2, 180, maxx div 2, maxy, white) % vertical line
    color (yellow)
    locate (1, 55)
    put "INSTRUCTIONS"
    locate (2, 42)
    put "-Select 1,2,3 or 4 as your answer"
   
 
    locate (4, 42)
    put "-5 gives the fifty-fifty lifeline"
    locate (5, 42)
    put "-6 gives the phonecall lifeline."
   
   
    %where the choices are places
    locate (15, 2)
    put question ..
    locate (21, 2)
    put choicea ..
    locate (21, 42)
    put choiceb ..
    locate (24, 2)
    put choicec ..
    locate (24, 42)
    put choiced ..
color (green)
    locate (18, 2)
    put "What Do You Think The Answer Is ???" ..
    get answer
   
    if answer = 5 then%lifelines
        fiftyfifty
    elsif answer = 6 then
        phone
    end if
    right
end format
%All the Questons for this program
%$100 question
procedure onehundred 
    cls
    value := 1
   
    put "For $100:"
    put ""
    question := "What is the Capital of Canada?"
    choicea := "1)Quebec"
    choiceb := "2)Ontario"
    choicec := "3)Ottawa"
    choiced := "4)Toronto"
    right_answer := 3
    format
   
end onehundred
%$200 question
procedure twohundred 
    cls
    value := 2
    put "For $200:"
    put ""
    question := "What Year Did WW1 Star?"
    choicea := "1)1941"
    choiceb := "2)1914"
    choicec := "3)1491"
    choiced := "4)9141"
    right_answer := 2
    format
end twohundred
 %$500 question
procedure fivehundred
    cls
    value := 3
    put "For $500:"
    put ""
    question := "What are the three forms of matter?"
    choicea := "1)Solid, Liquid  and Gas"
    choiceb := "2)Solid, Liquid and Air"
    choicec := "3)Ice, Water and Steam"
    choiced := "4)Solid, Liquid and plasma"
    right_answer := 1
    format
end fivehundred
%$1,000 question
procedure oneth
    cls
    value := 4
    put "For $1 000:"
    put ""
    question := "What Was The Name of The Cat off Of Cat And Dog ?"
    choicea := "1)Fred"
    choiceb := "2)Kat "
    choicec := "3)cat"
    choiced := "4)kitty"
    right_answer := 3
    format
end oneth
%$2,000 question
procedure twoth
    cls
    value := 5
    put "For $2 000:"
    put ""
    question := "What Color boots off of dora the explorer?"
    choicea := "1)Brown"
    choiceb := "2)green"
    choicec := "3)bule"
    choiced := "4)orange"
    right_answer := 3
    format
end twoth
 %$4,000 question
procedure fourth
    cls
    value := 6
    put "For $4 000:"
    put ""
    question := "How Many ?"
    choicea := "1)Brown"
    choiceb := "2)green"
    choicec := "3)bule"
    choiced := "4)orange"
    right_answer := 3
    format
end fourth
%main program
onehundred
twohundred
fivehundred
oneth
twoth
fourth
cls







Can People help me make this tihng exit when u lose and make the life line work better.
thankz

[Mod Edit: Please use syntax tags, Usage is
[syntax="Turing"] Code here [/syntax]
Sponsor
Sponsor
Sponsor
sponsor
apomb




PostPosted: Tue Jun 03, 2008 3:20 pm   Post subject: RE:MILLIONAIRE! [Can any one help make is better ]

Yes, i can help make it better, but that would require me to be able to add code or syntax tags to your post. which i currently do not have the power to do.

otherwise, im not going to torture myself and read poorly formatted code.
broud13




PostPosted: Tue Jun 03, 2008 6:09 pm   Post subject: Re: MILLIONAIRE! [Can any one help make is better ]

in the dora's boots question u spelled blue wrong
CodeMonkey2000




PostPosted: Tue Jun 03, 2008 6:22 pm   Post subject: RE:MILLIONAIRE! [Can any one help make is better ]

Putting all your questions in a data file would be very useful. With data file you can change, add and delete questions with ease.
Sean




PostPosted: Wed Jun 04, 2008 6:27 am   Post subject: Re: MILLIONAIRE! [Can any one help make is better ]

Also, making sure everything is spelt right in your program would be good.

Also, look at your fourth question, what are you asking? How Many? But then give colours as your possible answers?

Turing:

procedure fourth
    cls
    value := 6
    put "For $4 000:"
    put ""
    question := "How Many Questions Have Been Asked So Far?"
    choicea := "1)6"
    choiceb := "2)7"
    choicec := "3)4"
    choiced := "4)5"
    right_answer := 3
    format
end fourth


A possible question you can use.

Furthermore, you can also change your choices into an array, instead of having them all as different variables.
spike0721




PostPosted: Wed Jun 04, 2008 6:29 pm   Post subject: RE:MILLIONAIRE! [Can any one help make is better ]

that cause i was no done, and i can't tihnk of any more questions.
gitoxa




PostPosted: Wed Jun 04, 2008 6:37 pm   Post subject: RE:MILLIONAIRE! [Can any one help make is better ]

twoth? oh hai thar, Mr Fudd.
jeffgreco13




PostPosted: Thu Jun 05, 2008 10:26 am   Post subject: Re: MILLIONAIRE! [Can any one help make is better ]

No doubt about it use external files for questions. Or even just one file. Look up Turing: File IO on how to do it. It's very simple to use.

You could even arrange a procedure that will read one question at a time from the file and wait for the input. This will shorten your actual program itself up so much its ridiculous. Just use some ingenuity to read the file line by line and format it onscreen.

REMEMBER:
use an * to read an entire line rather than it stop at the first space.
Goodluck Very Happy
Sponsor
Sponsor
Sponsor
sponsor
SNIPERDUDE




PostPosted: Thu Jun 05, 2008 10:46 am   Post subject: RE:MILLIONAIRE! [Can any one help make is better ]

Isn't this supposed to be under turing help?
weebly




PostPosted: Thu Jun 05, 2008 9:45 pm   Post subject: RE:MILLIONAIRE! [Can any one help make is better ]

put buttuon and error traps..
jdubzisyahweh




PostPosted: Wed Feb 24, 2010 12:40 pm   Post subject: RE:MILLIONAIRE! [Can any one help make is better ]

pls see my post, may be helpfull, lol
iff you want to read 12600 lines of code
USEC_OFFICER




PostPosted: Wed Feb 24, 2010 12:56 pm   Post subject: RE:MILLIONAIRE! [Can any one help make is better ]

It has been two years. I'm sure they don't need anymore help.
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  [ 12 Posts ]
Jump to:   


Style:  
Search: