Thread: High Scores

  1. #1
    Registered User Gnoober's Avatar
    Join Date
    Oct 2002
    Posts
    40

    High Scores

    I am really in a bind here trying to implement high scores into a console app. I just don't understand file reading and writing. The books I have don't cover it very well. Here's some psuedo code, maybe someone could help me out or send me a sample.
    (I _do_ know how to open the file)
    [code]

    File.open("data.txt", ios:ut | ios::in);

    get # of lines
    go to the lowest line

    if (score > lowest score){

    while (money > current line's score){

    current line's score = next line up;
    }

    move everything below current line down one line;
    insert score and name in empty line;

    if (# of lines == 10){

    delete last line;
    }

    }

    Thanks guys!

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Any file i/o tutorial will answer any of the questions presented here for you.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    First make an attempt to implement the solution. Post a specific question afterward if applicable.

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Keeping high scores for pong
    By trev456 in forum C++ Programming
    Replies: 6
    Last Post: 04-16-2007, 04:44 AM
  2. High Scores - A Dilemma
    By CrazyNorman in forum Game Programming
    Replies: 5
    Last Post: 12-28-2006, 09:01 PM
  3. Store high scores in exe file
    By Nutshell in forum Game Programming
    Replies: 12
    Last Post: 04-27-2003, 04:09 PM
  4. Help on high scores
    By Gnoober in forum C++ Programming
    Replies: 0
    Last Post: 02-17-2003, 07:28 PM
  5. Working on High Scores...
    By Gnoober in forum C++ Programming
    Replies: 4
    Last Post: 02-16-2003, 12:50 PM