uses crt;
var x,s:integer;
c:char; b:boolean;
begin
while b=false do begin
x:=random(10);
if (x=4) or (x=5) then s:=s+50;
if (x=3) or (x=6) then s:=s-50;
if (x=2) or (x=7) then s:=s*2;
if (x=1) or (x=8) then sound(1000);
writeln('You points - ',s,' ',x);
if (x=1) or (x=8) or (s<0) or (c='No') then b:=true;
if b=false then begin
writeln('Continue? Enter "No" to exit.');
readln(c);
end;
end;
delay(10000);
nosound;
end.