9 # define Intrange ( f, l ) int ( Rnd * ((( l ) + 1 ) - ( f )) + ( f )) Type pair As Integer x, y End Type Operator = ( a As pair, b As pair ) As Integer Return a. Requires the GDI+ standard library by tic: Gotoxy(x OF center + x OF set,y OF center + y OF set) IF sqrt(x*x+y*y)>=inside radius AND sqrt(x*x+y*y)<=radius THEN PROC swap with last set = (INT position,INT where last set)VOID: Put_Line ( "Chosen from precalculated:" ) Print_Points ( My_Circle_Precalculated ) end Circle Put_Line ( "Randomly generated:" ) Print_Points ( My_Circle_Randomly ) Ada. New_Line end loop end Print_Points My_Circle_Randomly : Point_List := Generate_Random_Points My_Circle_Precalculated : Point_List := Choose_Precalculated begin Ada. Put ( Output_String ( Column, Line )) end loop Ada. Y ) := '*' end loop for Line in Output_String ' Range ( 2 ) loop for Column in Output_String ' Range ( 1 ) loop Ada. Y ** 2 begin return 10 ** 2 ( others => ' ' )) begin for N in Points ' Range loop Output_String ( Points ( N ). 15 type Point is record X, Y : Coordinate end record type Point_List is array ( Positive range ) of Point function Acceptable ( Position : Point ) return Boolean is Squared_Sum : Natural := Position. With Ada.Text_IO with _Random procedure Circle is - extreme coordinate values are -15:0, 15:0, 0:-15, 0:15 subtype Coordinate is Integer range - 15.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |