Solved

C++ scoring systems

Posted on 2004-03-24
5
307 Views
Last Modified: 2012-06-27
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
Comment
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
  • Learn & ask questions
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 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

by:SteH
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

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

Ouch :o)

Consider it as pseudocode then *g*
0
 
LVL 12

Expert Comment

by:stefan73
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

by:Ikram_Bohra
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!

thanking you in advance

                                                              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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to convert c++ code to Android App 3 132
c++, dynamic object by json 1 60
Finding Divisors 5 40
How to add columns to a RAD Studio FMX grid at design time 1 34
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question