text stringlengths 0 234 |
|---|
end graphics; |
function Generate |
return Integer is |
subtype Nums is Integer range 1..6; |
package RN is |
new Ada.Numerics.Discrete_Random(Nums); |
Gen : RN.Generator; |
begin |
RN.Reset(Gen); |
return RN.Random(Gen); |
Function Definition: function Triss(Rolls: Arr) |
Function Body: return Integer is |
begin |
for I in 1..3 loop |
if Rolls(I) = Rolls(I+1) and Rolls(I) = Rolls(I+2) then |
return 3 * Rolls(I); |
end if; |
end loop; |
return 0; |
Function Definition: procedure goto_prev is |
Function Body: begin |
-- Clear screen |
for X in 1..17 loop |
Goto_XY(Coord_Config_X, Coord_Config_Y + X * 2); |
Put(ASCII.ESC & bg_color); |
Put(" "); |
Goto_XY(1000,1000); |
end loop; |
if Curr_Index_Selected = 1 then |
Curr_Index_Selected := 16; |
end if; |
loop |
Curr_Index_Selected := Curr_Index_Selected - 1; |
if avail_points(Curr_Index_Selected) >= 0 then |
exit; |
end if; |
if Curr_Index_Selected = 1 then |
Curr_Index_Selected := 16; |
end if; |
end loop; |
if Curr_Index_Selected > 6 then |
Goto_XY(Coord_Config_X, Coord_Config_Y + Curr_Index_Selected * 2 + 4); |
else |
Goto_XY(Coord_Config_X, Coord_Config_Y + Curr_Index_Selected * 2); |
end if; |
Set_Foreground_Colour(Red); |
Put("=>"); |
Set_Foreground_Colour(Black); |
Goto_XY(1000,1000); |
end goto_prev; |
procedure goto_next is |
begin |
-- Clear screen |
for X in 1..17 loop |
Goto_XY(Coord_Config_X, Coord_Config_Y + X * 2); |
Put(ASCII.ESC & bg_color); |
Put(" "); |
Goto_XY(1000,1000); |
end loop; |
if Curr_Index_Selected = 15 then |
Curr_Index_Selected := 0; |
end if; |
loop |
Curr_Index_Selected := Curr_Index_Selected + 1; |
if avail_points(Curr_Index_Selected) >= 0 then |
exit; |
end if; |
if Curr_Index_Selected = 15 then |
Curr_Index_Selected := 0; |
end if; |
end loop; |
if Curr_Index_Selected > 6 then |
Goto_XY(Coord_Config_X, Coord_Config_Y + Curr_Index_Selected * 2 + 4); |
else |
Goto_XY(Coord_Config_X, Coord_Config_Y + Curr_Index_Selected * 2); |
end if; |
Set_Foreground_Colour(Red); |
Put("=>"); |
Set_Foreground_Colour(Black); |
Goto_XY(1000,1000); |
end goto_next; |
begin |
-- Build array of available slots |
for x in 1..15 loop |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.