1 (* Copyright (C) 2005-2024 Free Software Foundation, Inc. *)
2 (* This file is part of GNU Modula-2.
4 GNU Modula-2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 3, or (at your option) any later
9 GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License along
15 with gm2; see the file COPYING. If not, write to the Free Software
16 Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *)
17 DEFINITION MODULE StoreCoords ;
24 System : LOGITECH MODULA-2/86
25 Description: Provides a list of unique coordinates.
26 These coordinates maybe randomly requested.
29 EXPORT QUALIFIED InitCoords, KillCoords,
30 GetAndDeleteRandomCoord, AddCoord, CoordsExist ;
33 InitCoords - Initializes a potential list of coordinates.
34 An index to this potential coordinate list is returned.
37 PROCEDURE InitCoords () : CARDINAL ;
41 KillCoords - Kills a complete coordinate list.
44 PROCEDURE KillCoords (CoordListIndex: CARDINAL) ;
48 GetAndDeleteRandomCoord - Returns a random coordinate from the coordinate
49 list and then it is deleted from the list.
52 PROCEDURE GetAndDeleteRandomCoord (CoordListIndex: CARDINAL;
57 AddCoord - places a coordinate into the specified list.
60 PROCEDURE AddCoord (CoordListIndex: CARDINAL; x, y: CARDINAL) ;
64 CoordsExist - returns true if a coordinate exists
65 within the CoordListIndex.
68 PROCEDURE CoordsExist (CoordListIndex: CARDINAL) : BOOLEAN ;