Generation

generate functionMon, 21 Nov 2022

create a bool Attack with two int variables and ask user for input

static void Main(string[] args) { Console.WriteLine("Do you want to attack?"); string answer = Console.ReadLine(); if (answer == "yes") { Console.WriteLine("How much health do you have?"); int health = int.Parse(Console.ReadLine()); Console.WriteLine("How much damage do you want to do?"); int damage = int.Parse(Console.ReadLine()); Console.WriteLine("Your new health is: " + (health - damage)); } }

Want to kickstart your project?Use the new AI Studio to create your code