program bk;
uses crt;
var kr,i,xp1,xp2,hit1,hit2,blok1,blok2:byte; name,h1,h2,b1,b2:string; cursor:char;
begin
clrscr;
randomize;
textcolor(red);
write('Enter Your Name: ');
read(name);
i:=1;
kr:=1;
xp1:=10;
xp2:=10;
repeat;
repeat;
repeat;
if kr>2then kr:=kr-2;
clrscr;
textcolor(yellow);
write(name,' ');
if xp1=10thenwrite('IIIIIIIIII')
elseif xp1=9thenwrite('IIIIIIIII ')
elseif xp1=8thenwrite('IIIIIIII ')
elseif xp1=7thenwrite('IIIIIII ')
elseif xp1=6thenwrite('IIIIII ')
elseif xp1=5thenwrite('IIIII ')
elseif xp1=4thenwrite('IIII ')
elseif xp1=3thenwrite('III ')
elseif xp1=2thenwrite('II ')
elseif xp1=1thenwrite('I ');
write(' enemy ');
if xp2=10thenwrite('IIIIIIIIII')
elseif xp2=9thenwrite('IIIIIIIII ')
elseif xp2=8thenwrite('IIIIIIII ')
elseif xp2=7thenwrite('IIIIIII ')
elseif xp2=6thenwrite('IIIIII ')
elseif xp2=5thenwrite('IIIII ')
elseif xp2=4thenwrite('IIII ')
elseif xp2=3thenwrite('III ')
elseif xp2=2thenwrite('II ')
elseif xp2=1thenwrite('I ');
writeln('');
if i=1then textcolor(green) else textcolor(white);
if kr=1then writeln('1. head hit');
if kr=2then writeln('1. head blok');
if i=2then textcolor(green) else textcolor(white);
if kr=1then writeln('2. upper body hit');
if kr=2then writeln('2. upper body blok');
if i=3then textcolor(green) else textcolor(white);
if kr=1then writeln('3. lower body hit');
if kr=2then writeln('3. lower body blok');
if i=4then textcolor(green) else textcolor(white);
if kr=1then writeln('4. legs hit');
if kr=2then writeln('4. legs blok');
cursor:=readkey;
case cursor of#72:i:=i-1;
#80:i:=i+1;
end;
if i>4then i:=i-4;
if i<1then i:=i+4;
until cursor=#13;
if kr=1then hit1:=i;
if kr=2then blok1:=i;
kr:=kr+1;
until kr>2;
hit2:=random(4)+1;
blok2:=random(4)+1;
if hit1=1then h1:='head'elseif hit1=2then h1:='upper body'elseif hit1=3then h1:='lower body'else h1:='legs';
if hit2=1then h2:='head'elseif hit2=2then h2:='upper body'elseif hit2=3then h2:='lower body'else h2:='legs';
if blok1=1then b1:='head'elseif blok1=2then b1:='upper body'elseif blok1=3then b1:='lower body'else b1:='legs';
if blok2=1then b2:='head'elseif blok2=2then b2:='upper body'elseif blok2=3then b2:='lower body'else b2:='legs';
textcolor(blue);
if hit1<>blok2 thenbegin xp2:=xp2-1; writeln('Vi ydarili v ',h1); end;
if hit2<>blok1 thenbegin xp1:=xp1-1; writeln ('enemy ydaril v ',h2); end;
if hit1=blok2 then writeln('enemy zablokiroval ',b2);
if hit2=blok1 then writeln('Vi zablokirovali ',b1);
readkey;
until (xp1<=0) or (xp2<=0);
textcolor(cyan);
if (xp1<=0) and (xp2>0) then writeln('YOU LOSE')
elseif (xp2<=0) and (xp1>0) then writeln('YOU WIN')
else writeln('NO WINNER');
readkey;
end.
Archon
27.05.2007 22:58
Я вот думаю, какой смысл играть в игры, где результат все равно определяется по рэндому?..
Tan
28.05.2007 9:17
В случае когда один играешь, то да, не особо весело, а когда с кем - то, то элемент соревновательности заключается в том, кому удача улыбнётся большее количетво раз.
Это текстовая версия — только основной контент. Для просмотра полной версии этой страницы, пожалуйста, нажмите сюда.