Computer Science Canada (TURING) Urgent, need help on multiple choices.. |
Author: | pink00rock [ Sat Feb 07, 2004 4:18 pm ] | ||
Post subject: | (TURING) Urgent, need help on multiple choices.. | ||
Hey!! Sup people? .. I need help badly.. and i'm so confused with the code i have. (its a multiple choice question, and i'll show you the problem with it on the buttom)
The problem is, when the code is outputted. And the user can only guess twice, but on the 2nd wrong guess, it sas "Sorry, guess again" --> (the output) How many months are there in a year? a) 13 b) 11 c) 12 Please enter your answer. (type a, b or c) a Sorry, guess again Please enter your answer. (type a, b or c) b Sorry, guess again ------------------- the PROBLEM is --> it says "sorry guess again" twice! i want it to say something like "Sorry, no more guesses --> next question!" Can someone please help me, thanks - |
Author: | santabruzer [ Sat Feb 07, 2004 4:22 pm ] | ||
Post subject: | |||
anyways.. ehre is a solution :
|
Author: | Paul [ Sat Feb 07, 2004 4:23 pm ] | ||
Post subject: | |||
darn it, took too long to copy and paste, but your way is better santabruzer |
Author: | santabruzer [ Sat Feb 07, 2004 4:26 pm ] |
Post subject: | |
25 lines.. versus.. 28.. i think we know who the winner is ... ah.. that happens to me often.. too.. at the same time the post... |
Author: | Cervantes [ Sat Feb 07, 2004 4:32 pm ] |
Post subject: | |
lol its the same thing its just else / if or elsif |
Author: | santabruzer [ Sat Feb 07, 2004 4:33 pm ] |
Post subject: | |
and another variable.. really .. really.. it's no different |
Author: | TheXploder [ Sat Feb 07, 2004 4:39 pm ] | ||
Post subject: | |||
or 23 lines:
|
Author: | .hack [ Sat Feb 07, 2004 5:00 pm ] |
Post subject: | |
or you could loop it. thats what I have done in the past for my cash register. if the user enters an payment amount which is less then the subototal it asks for a new payment, enter wrong payments till the cows come home! |
Author: | Andy [ Sat Feb 07, 2004 5:01 pm ] | ||
Post subject: | |||
i smell a competition
18 lines plus it looks better |
Author: | pink00rock [ Sat Feb 07, 2004 5:33 pm ] |
Post subject: | |
whoa! thanks guys! lol you guys are wicked at turing.. i wonder how long u been turing for lol. me, only 5 months, but don't practise much.. well thank you once again guys!.. take care - bye! |
Author: | TheXploder [ Sat Feb 07, 2004 5:34 pm ] | ||
Post subject: | |||
competition indeed 15 lines...
|
Author: | santabruzer [ Sat Feb 07, 2004 5:34 pm ] |
Post subject: | |
i've been at turing for i think 4.5 months.. well i had it last sem.. so.... |
Author: | TheXploder [ Sat Feb 07, 2004 5:36 pm ] | ||||
Post subject: | |||||
but then ofcourse for the counter to be right you just need to put this:
instead of the usual one:
|
Author: | santabruzer [ Sat Feb 07, 2004 5:39 pm ] | ||
Post subject: | |||
TheXploder wrote:
wouldn't it use 'strint'? EDIT: After closer inspection.. nm |
Author: | Andy [ Sat Feb 07, 2004 5:54 pm ] |
Post subject: | |
you should've used strint... have counter:=intstr(strint(counter)+1) |
Author: | TheXploder [ Sat Feb 07, 2004 6:56 pm ] |
Post subject: | |
that's way to complicated to understand... |
Author: | Andy [ Sat Feb 07, 2004 8:02 pm ] |
Post subject: | |
ur the one who wants to do string addition |
Author: | TheXploder [ Sat Feb 07, 2004 8:47 pm ] |
Post subject: | |
but your the one who complicates it my thing works.. |
Author: | Andy [ Sat Feb 07, 2004 8:48 pm ] |
Post subject: | |
thats cuz ur thing can only hold count up to 256... mine can do 10^256 |