program dicegame; uses crt; var a,b,c : integer; ans1 : integer; ans2 : char; use, point : integer; n : integer; begin randomize; point := 1000; repeat clrscr; writeln('Welcome! You have ',point,' points'); writeln; writeln('Make Your Guess'); writeln('==============='); writeln('1. SMALL'); writeln('2. BIG'); writeln('3. NUMBER'); writeln; repeat write('1-3 ? '); readln(ans1); until (ans1 <= 3) and (ans1>=1); if (ans1 = 3) then begin write('Choose a number: '); readln(n); end; writeln; repeat write('Points use: '); readln(use); until use <= point; writeln; writeln('Press enter to draw the dice...'); readln; a := random(6)+1; b := random(6)+1; c := random(6)+1; writeln(a, ' ',b,' ',c); if (ans1 = 3) then if (a+b+c =n) then begin point := point + 2*use; writeln('You WIN! You got ',use,' points!'); writeln('You have ',point,' points.'); end; else if ((a+b+c) <= 10) and (ans1 = 1) or ((a+b+c) > 10) and (ans1 = 2) then begin point := point + use; writeln('You WIN! You got ',use,' points!'); writeln('You have ',point,' points.'); end else begin point := point - use; writeln('You LOSE! You lose ',use,' points!'); writeln('You have ',point,' points.'); end; writeln; write('Do you want to continue? '); readln(ans2); until ans2 = 'N'; end.