Created
March 7, 2015 09:30
-
-
Save Kanol/68a00901ae964ab838c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Бетмен_против_ниндзя | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Int32 Rand, HPBatman = 100, HPTurtle = 100, Answer; | |
String FightUp; | |
Console.WriteLine("Бой до конца!"); | |
Console.WriteLine("Можно бить в ноги, корпус и голову"); | |
Console.WriteLine("Бэтман начинает"); | |
while ((HPBatman>0)&&(HPTurtle>0)) | |
{ | |
String Fight = Console.ReadLine(); | |
FightUp = Fight.ToUpper(); | |
Answer = FightUp.IndexOf("Н"); | |
if (Answer == 0) | |
{ | |
Random rnd = new Random(DateTime.Now.Millisecond); | |
Rand = rnd.Next(0, 6); | |
if ((Rand == 1)||(Rand == 2)||(Rand == 3)) | |
{ | |
HPBatman = HPBatman - 5; | |
Console.Write("ХП Бэтмана: "); | |
Console.WriteLine(HPBatman); | |
} | |
} | |
else | |
{ | |
Answer = FightUp.IndexOf("Г"); | |
if (Answer == 0) | |
{ | |
Random rnd = new Random(DateTime.Now.Millisecond); | |
Rand = rnd.Next(0, 6); | |
if ((Rand == 1) || (Rand == 2)) | |
{ | |
HPBatman = HPBatman - 10; | |
Console.Write("ХП Бэтмана: "); | |
Console.WriteLine(HPBatman); | |
} | |
} | |
else | |
{ | |
Answer = FightUp.IndexOf("К"); | |
if (Answer == 0) | |
{ | |
Random rnd = new Random(DateTime.Now.Millisecond); | |
Rand = rnd.Next(0, 6); | |
if (Rand == 1) | |
{ | |
HPBatman = HPBatman - 20; | |
Console.Write("ХП Бэтмана: "); | |
Console.WriteLine(HPBatman); | |
} | |
} | |
} | |
} | |
Fight = Console.ReadLine(); | |
FightUp = Fight.ToUpper(); | |
Answer = FightUp.IndexOf("К"); | |
if (Answer == 0) | |
{ | |
Random rnd = new Random(DateTime.Now.Millisecond); | |
Rand = rnd.Next(0, 6); | |
if ((Rand == 1)||(Rand == 2)||(Rand == 3)) | |
{ | |
HPTurtle = HPTurtle - 5; | |
Console.Write("ХП Черепашек: "); | |
Console.WriteLine(HPTurtle); | |
} | |
} | |
else | |
{ | |
Answer = FightUp.IndexOf("Н"); | |
if (Answer == 0) | |
{ | |
Random rnd = new Random(DateTime.Now.Millisecond); | |
Rand = rnd.Next(0, 6); | |
if ((Rand == 1) || (Rand == 2)) | |
{ | |
HPTurtle = HPTurtle - 10; | |
Console.Write("ХП Черепашек: "); | |
Console.WriteLine(HPTurtle); | |
} | |
} | |
else | |
{ | |
Answer = FightUp.IndexOf("Г"); | |
if (Answer == 0) | |
{ | |
Random rnd = new Random(DateTime.Now.Millisecond); | |
Rand = rnd.Next(0, 6); | |
if (Rand == 1) | |
{ | |
HPTurtle = HPTurtle - 20; | |
Console.Write("ХП Черепашек: "); | |
Console.WriteLine(HPTurtle); | |
} | |
} | |
} | |
} | |
} | |
if (HPBatman == 0) | |
{ | |
Console.WriteLine("Бэтман ПРОИГРАЛ! Черепашки ВЫИГРАЛИ!"); | |
} | |
else | |
{ | |
Console.WriteLine("Черепашки ПРОИГРАЛИ! Бэтман ВЫИГРАЛ!"); | |
} | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment