1个回答
展开全部
var a:integer;
b:string;
begin
randomze;
repeat
a:=random(3);
readln(b);
case a of:
0:if b='bu' then writeln('a draw!) else if b='jiandao' then writeln('you win!') else writeln('you lose!);
1:if b='bu' then writeln('you lose!') else if b='jiandao' then writeln('a draw!') else writeln('you win!);
2:if b='bu' then writeln('you win!') else if b='jiandao' then writeln('you lose!') else writeln('a draw!');
end;
write('Do you want to replay?(Y/N)'); readln(b);
until (b='N') or (b='n');
end.
三种输入:
shitou:石头
jiandao:剪刀
bu:布
然后会问你:Do you want to replay?(Y/N),如果输入N或n,则退出游戏,否则继续。
望采纳!!!
b:string;
begin
randomze;
repeat
a:=random(3);
readln(b);
case a of:
0:if b='bu' then writeln('a draw!) else if b='jiandao' then writeln('you win!') else writeln('you lose!);
1:if b='bu' then writeln('you lose!') else if b='jiandao' then writeln('a draw!') else writeln('you win!);
2:if b='bu' then writeln('you win!') else if b='jiandao' then writeln('you lose!') else writeln('a draw!');
end;
write('Do you want to replay?(Y/N)'); readln(b);
until (b='N') or (b='n');
end.
三种输入:
shitou:石头
jiandao:剪刀
bu:布
然后会问你:Do you want to replay?(Y/N),如果输入N或n,则退出游戏,否则继续。
望采纳!!!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询