using System; class Battle { public static void Main() { int enemy_hp = 20; int my_hp = 20; while( (enemy_hp > 0) && (my_hp > 0) ) { string attack = ""; while( (attack != "punch") && (attack != "kick") ) { Console.WriteLine("HP: {0}", my_hp); Console.WriteLine("ENEMY: {0}", enemy_hp); Console.WriteLine("Do you want to punch or kick?"); attack = Console.ReadLine(); } Console.WriteLine(); if(attack == "punch") { Console.WriteLine("You punch the enemy!"); Console.WriteLine("The enemy takes 2 damage!"); enemy_hp -= 2; } else if(attack == "kick") { Console.WriteLine("You kick the enemy!"); Console.WriteLine("The enemy takes 4 damage!"); enemy_hp -= 4; } Console.WriteLine("The enemy clobbers you!"); Console.WriteLine("You take 3 damage!"); my_hp -= 3; } if(enemy_hp <= 0) Console.WriteLine("The enemy has fallen!"); if(my_hp <= 0) Console.WriteLine("You have fallen!"); else { Console.WriteLine("You stand victorious!"); Console.WriteLine("You gained 5 xp!"); Console.WriteLine(); Console.WriteLine("Level 2!"); Console.WriteLine("HP: +3"); Console.WriteLine("MP: +2"); Console.WriteLine("STR: +1"); Console.WriteLine("INT: +3"); Console.WriteLine("VIG: +2"); Console.WriteLine(); Console.WriteLine("Type 'ok' to finish"); string input = ""; while(input != "ok") { input = Console.ReadLine(); } Console.WriteLine("Bye~! ^.^"); } } }