uses crt;
var
money,st,a,b:real;
procedure logo;
begin
clrscr;
textcolor(green);
writeln('---------');
writeln('- bones -');
writeln('---------');
textcolor(white);
repeat until keypressed;
end;
procedure game;
begin
clrscr;
write('You have:');
textcolor(yellow);
write(money:3:0);
textcolor(white);
writeln('$');
write('Your stake:');
readln(st);5
if money<st then writeln('You haven''t so much money!');
if money>=st then
begin
a:=random(6+1);
write('Your rezult is ');
textcolor(red);
writeln(a:1:0);
textcolor(white);
b:=random(6+1);
write('Your oponent''s rezult is ');
textcolor(red);
writeln(b:1:0);
textcolor(white);
if a>b then money:=money+st;
if a<b then money:=money-st;
if a=b then writeln('Your rezults are same');
repeat until keypressed;
end;
end;
procedure endd;
begin
clrscr;
if money>199 then
 begin
 textcolor(yellow);
 writeln('You win :) ');
 textcolor(white);
 end;
if money=0 then
 begin
 textcolor(red);
 writeln('You loose :( ');
 textcolor(white);
 end;
repeat until keypressed;
end;
begin
logo;
money:=50;
while (money<>0) and (money<200) do game;
if (money=0) or (money>199) then endd;
repeat until keypressed;
end.