Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# C++ scoring systems

Posted on 2004-03-24
Medium Priority
311 Views
i am trying to make a "Who Wants To Be a Millionaire" type game and am having problems with the scoring system.
e.g. i want to be able to step-up the through the winings, from £100 to £200 etc. the winings are shown by a cricle inside a panel alongside the prize(s).

if (edtnum->Text)) = (lblnum->Caption);
{
scorestate = onehund;
if  (scorestate = onehund);
{
cric1->Visible=true;
}
}

this is how far ive got, by creating a enum state called 'scorestate' and setting 15 states to represent the prizes.
0
Question by:Ikram_Bohra
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 86

Accepted Solution

jkr earned 1000 total points
ID: 10668857
Put the scores into an array to iterate through them, e.g.

unsigned int scorepos = 0;
scorestate aScoreStates [] = { onehun, twohun, ... onemill};

scorestate score = aScoreStates [ scorepos];

if ( successful_answer = true) ++scorepos;

0

LVL 13

Expert Comment

ID: 10668898
>>  if  (scorestate = onehund);
This line should be
if  (scorestate == onehund);
to compare to values. The first assigns scorestate the value of onehund and this is not 0 so true.

The same holds for sample from jkr.
0

LVL 86

Expert Comment

ID: 10668937
>>The same holds for sample from jkr.

Ouch :o)

Consider it as pseudocode then *g*
0

LVL 12

Expert Comment

ID: 10669887
Hi Ikram_Bohra,
Probably the best way to express the game is as a state machine with states like
play100
...
play1M

and three transitions each:
win, lose, quit

You can easily attach visual "goodies" or random events to the game states.

Cheers,

Stefan
0

Author Comment

ID: 10712688
this is to jkr,

in reference to your recent answer, i'm not quite sure exactly what you mean (i'm a rookie).  Could you please explain in a little more detail!

ORIGINAL MESSAGE

i am trying to make a "Who Wants To Be a Millionaire" type game and am having problems with the scoring system.
e.g. i want to be able to step-up the through the winings, from £100 to £200 etc. the winings are shown by a cricle inside a panel alongside the prize(s).

if (edtnum->Text)) = (lblnum->Caption);
{
scorestate = onehund;
if  (scorestate = onehund);
{
cric1->Visible=true;
}
}

this is how far ive got, by creating a enum state called 'scorestate' and setting 15 states to represent the prizes.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
###### Suggested Courses
Course of the Month9 days, 12 hours left to enroll