Visited := True loop - use random direction loop Next_Direction := Random_Direction. Generator function "-" ( Dir : Directions ) return Directions is begin case Dir is when North => return South when South => return North when East => return West when West => return East end case end "-" procedure Move ( Row : in out Height_Type Column : in out Width_Type Direction : Directions Valid_Move : out Boolean ) is begin Valid_Move := False case Direction is when North => if Row > Height_Type ' First then Valid_Move := True Row := Row - 1 end if when East => if Column if Column > Width_Type ' First then Valid_Move := True Column := Column - 1 end if when South => if Row False ) All_Tested : Boolean begin - mark as visited Maze ( Row, Column ). Generator Dir_Generator : Random_Direction. With _Random with Ada.Text_IO package body Mazes is package RNG is new _Random (Positive ) package Random_Direction is new _Random (Directions ) Generator : RNG. PROC GetNeighbors(BYTE x,y BYTE ARRAY n BYTE POINTER count) BYTE POINTER ptr pointer to the screen memory
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |