C# loading data from text file
<p>So I'm trying to load some data from a text file when the user types 'Load'. I have it sort of working, but there's a bug with it, it seems.</p>

<p>Let's say you buy an axe, which is 70 coins. You start with 100 coins, so you're left with 30 coins. You decide to save and exit the game. You come back and load your saved game, and you have 49 coins and 48 health points.</p>

<p>It also does the exact same thing when you save straight away with all the default values. I don't have any idea where it's get the value of 49 and 48 from.</p>

<pre><code>const string f = "savedgame.txt";

        using (StreamReader r = new StreamReader(f))
        {

            string line;
            while ((line = r.ReadLine()) != null)
            {
                player.gold = line[0];
                player.health = line[1];
                Console.WriteLine("Your game has been loaded.");
                menu.start(menu, shop, player, fishing, woodcut, mine, monster, quests, save, load);
            }
        }
</code></pre>

<p>This is my text file that I've just saved now.</p>

<pre><code>100
20
1
0
0
5
</code></pre>

<p>I've tried examples off Google, but they did the same thing. So I did a bit of research and made one myself.... Did the same thing.</p>

<p>I don't know how much I can show you guys, but I can show more if needed.</p>

<p>Am I doing something wrong?</p>
