     with Cursor;
     with Text_IO; use Text_IO;
     with TTY;

     procedure Dice is
     ----------------------------------------------------------------------
     ----------------------------------------------------------------------
       Counter : array ( 1..24 ) of natural := ( others => 0 );

     procedure Roll ( Dice : natural; Count : natural ) is
     ----------------------------------------------------------------------
     begin
       if Dice > 0 then
	 for A in 1..6 loop
	   Roll ( Dice - 1, Count + A );
	 end loop;
       else
	 if Count in Counter'range  then
	   Counter ( Count ) := Counter ( Count ) + 1;
	 end if;
	 Cursor.Move ( 0, 0 );
	 for Index in Counter'range loop
	   Put ( integer'image ( Index ) );
	   Put ( ":  " );
	   Put_Line ( natural'image ( Counter ( Index ) ) );
	 end loop;
       end if;
     end Roll;

     ----------------------------------------------------------------------
     ----------------------------------------------------------------------
     begin
       TTY.Clear_Screen;
       for Dice in 1..24 loop
	 Roll ( Dice, 0 );
       end loop;
     end Dice;
