Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSharpLight
- {
- public static class Program
- {
- public static void Main()
- {
- int health = 100;
- int damage = 5;
- int enemyHealth = 60;
- int enemyDamage = 8;
- while(health > 0 && enemyHealth > 0)
- {
- Console.WriteLine("На вас напали!");
- Console.Write("hit - сражаться,exit - бежать.Ваш выбор:");
- string inputPlayer = Console.ReadLine();
- if (inputPlayer == "exit")
- {
- break;
- }
- if (inputPlayer == "hit")
- {
- health -= enemyDamage;
- enemyHealth -= damage;
- }
- else
- {
- Console.WriteLine("У вас всего две команды:hit и exit.Пожалуйста сделайте выбор:");
- }
- Console.WriteLine(health);
- Console.WriteLine(enemyHealth);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment