program Noname2; var x,y,a: integer; z: string; b: char; begin a:=10; repeat randomize; repeat writeln; writeln('Rock:0 Paper:1 Scissors:2'); writeln('Your Score : ',a); write('Please input your choice: '); readln(x); writeln; if (x<0) and (x>2) then writeln('Only 0,1,2 can be inserted.'); until (x>=0) and (x<=2); if x= 0 then writeln(' You chose ROCK.'); writeln; if x= 1 then writeln(' You chose PAPER.'); writeln; if x= 2 then writeln(' You chose SCISSORS.'); writeln; y := random(3); if y =0 then z:= 'ROCK'; if y =1 then z:= 'PAPER'; if y =2 then z:= 'SCISSORS'; if x=y then writeln('The computer chose ',z,'. It is a tie.'); if (x=0) and (y=2) or (x=1) and (y=0) or (x=2) and (y=1) then begin writeln('The computer chose ',z,'. You won!'); a := a+1; end; if (y=0) and (x=2) or (y=1) and (x=0) or (y=2) and (x=1) then begin writeln('The computer chose ',z,'. You lost!'); a := a-1; end; writeln('Your Score : ',a); write('Do you want to play again?(Y/N)'); readln(b); readln; until b='N'; end.