]>
Commit | Line | Data |
---|---|---|
a945c346 | 1 | (* Copyright (C) 2005-2024 Free Software Foundation, Inc. *) |
1eee94d3 GM |
2 | (* This file is part of GNU Modula-2. |
3 | ||
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 | |
7 | version. | |
8 | ||
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 | |
12 | for more details. | |
13 | ||
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 ; | |
18 | ||
19 | (* | |
20 | Title : StoreCoords | |
21 | Author : Gaius Mulley | |
22 | Date : 15/7/88 | |
23 | LastEdit : 15/7/88 | |
24 | System : LOGITECH MODULA-2/86 | |
25 | Description: Provides a list of unique coordinates. | |
26 | These coordinates maybe randomly requested. | |
27 | *) | |
28 | ||
29 | EXPORT QUALIFIED InitCoords, KillCoords, | |
30 | GetAndDeleteRandomCoord, AddCoord, CoordsExist ; | |
31 | ||
32 | (* | |
33 | InitCoords - Initializes a potential list of coordinates. | |
34 | An index to this potential coordinate list is returned. | |
35 | *) | |
36 | ||
37 | PROCEDURE InitCoords () : CARDINAL ; | |
38 | ||
39 | ||
40 | (* | |
41 | KillCoords - Kills a complete coordinate list. | |
42 | *) | |
43 | ||
44 | PROCEDURE KillCoords (CoordListIndex: CARDINAL) ; | |
45 | ||
46 | ||
47 | (* | |
48 | GetAndDeleteRandomCoord - Returns a random coordinate from the coordinate | |
49 | list and then it is deleted from the list. | |
50 | *) | |
51 | ||
52 | PROCEDURE GetAndDeleteRandomCoord (CoordListIndex: CARDINAL; | |
53 | VAR x, y: CARDINAL) ; | |
54 | ||
55 | ||
56 | (* | |
57 | AddCoord - places a coordinate into the specified list. | |
58 | *) | |
59 | ||
60 | PROCEDURE AddCoord (CoordListIndex: CARDINAL; x, y: CARDINAL) ; | |
61 | ||
62 | ||
63 | (* | |
64 | CoordsExist - returns true if a coordinate exists | |
65 | within the CoordListIndex. | |
66 | *) | |
67 | ||
68 | PROCEDURE CoordsExist (CoordListIndex: CARDINAL) : BOOLEAN ; | |
69 | ||
70 | ||
71 | END StoreCoords. |