Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.InputEncoding = Encoding.Unicode;
- Console.OutputEncoding = Encoding.Unicode;
- Console.Write( "Input start gold value : " );
- string goldValueRaw = Console.ReadLine();
- int goldValue = int.Parse( goldValueRaw );
- Console.Write( "Input start crystals value : " );
- string crystalsValueRaw = Console.ReadLine();
- int crystalsValue = int.Parse( crystalsValueRaw );
- Console.Write( "Input crystals price : " );
- string crystalPriceRaw = Console.ReadLine();
- int crystalPrice = int.Parse( crystalPriceRaw );
- bool loopExitFlag = false;
- while ( !loopExitFlag )
- {
- Console.WriteLine( $"Gold = {goldValue}, Cry = {crystalsValue}\n" );
- Console.Write( "Buy crystals, input count : " );
- string buyCrystalsCountRaw = Console.ReadLine();
- int buyCrystalsCount = int.Parse( buyCrystalsCountRaw );
- goldValue -= buyCrystalsCount * crystalPrice;
- crystalsValue += buyCrystalsCount;
- Console.WriteLine( "Continue? Enter 'n' for exit" );
- string continueAnswer = Console.ReadLine();
- string exitAnswer = "n";
- loopExitFlag = string.Equals( continueAnswer, exitAnswer );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement