<blockquote class="quote"><div class="op">Quote:</div>int health, door,level; health = 20; level = 20; string name; Console.WriteLine("write your name "); name = Convert.ToString(Console.ReadLine()); Console.WriteLine("hello " + name + " welcome to the ddungeon \n"); Console.WriteLine("you want to open the the right door (press 1) or the left one (press 2)"); door = Convert.ToInt32(Console.ReadLine()); while(level < 20 && health > 0) { door = Convert.ToInt32(Console.ReadLine()); if (door == 1) { Console.WriteLine("you have chance "); Console.WriteLine(health); health++; level++; } else if (door == 2) { health--; level--; Console.WriteLine(health); } } Console.Read();</blockquote>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)