Computer problems,Computer help
*AX SOFT>>>Programming & Design

How do I keep a running total score in c++?


I'm trying to create a word puzzle game with c++ where the computer generates a scrambled word. The player has to guess the word to win the game. I have all that but, I want the player to have a score and I'm having trouble keeping a running score....the score seems to reset once the loop starts over again instead of adding the score from the first loop to the second and so on until the player quits....any help would be greatly appreciated THANKS!

Set the value to 0 above the loop and add to the value

test = 0;

loop{

score = 15;
test+=score;
}

cout << test

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Use ASP .NET's membership system or roll your own?

    Well the pro's are pretty obvious. It offers you a ready component for use to save/retrieve users for your website, it integrates pretty well very easily with Login server controls thus saving...

  • Is there an equivalent for the GetChar() function from VB.Net in VB6?

    Have you tried Mid(String,Index,Length)? MyString = "HELLO!" Print Mid(MyString,2,1) Would print "E"

    ...
  • ASCII/ANSI Character codes?

    You need to look at unicode, ASCII only covers the 256 characters, Unicode however uses 4 Bytes (32 bits) to store the character information (as opposed to two) and so can store mush more. As fo...

  • Sending POST Using <a href=...> instead of the submit button?

    What about using JavaScript to submit hidden forms when the link is clicked? :) For instance.. <form action="post.php" id="frm" method="post" style="displa...

  • In JSP I want to print out my database entries with the newest first?

    Order them in the DB query. Instead of SELECT * FROM ARTICLE Use something like SELECT * FROM ARTICLE ORDER BY Date DESC If you don't have a Date column use what ever column deno...

  • In Java, how do you outline a Polyline?

    you could try drawing the line twice. first in black with width 2 pixels and then in green with width 1 pixel.

    ...
  • How much to charge for making an ecommerce website for a small business?

    concentrate on the design work, do a mock up or a layout first, and get their interest. Give them a full list of all the functions.... Don't focus/talk on price, focus on what you will be of...

  • How do i fix this "line b problem parsing xml:'null" is null or not an object"?

    I guess you use AT&T. You need to report this problem to them, it is a bug in their JavaScript and there's nothing you can do about it apart from report it to them.

    ...
  •  

    Categories--Copyright/IP Policy--Contact Webmaster