Debian Codegraph @

gcc/testsuite/gm2/examples/map/pass/BoxMap.def

raw
1 (* Copyright (C) 2005-2025 Free Software Foundation, Inc. *)
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 BoxMap ;
18
19 (*
20 Title : BoxMap
21 Author : Gaius Mulley
22 Date : 18/7/88
23 LastEdit : 18/7/88
24 System : LOGITECH MODULA-2/86
25 Description: Generates a simple random map full of boxes.
26 Box corridors and box rooms.
27 All boxes are contained in the array Boxes and
28 1..NoOfCorridorBoxes are the corridor boxes and
29 NoOfCorridorBoxes..NoOfBoxes are the room boxes.
30 *)
31
32 EXPORT QUALIFIED MaxBoxes, MaxX, MaxY,
33 MaxDoorLength, MinDoorLength,
34 CorridorWidth, CorridorDoorLength,
35 TotalCorridorLength, MinDistanceBetweenCorridors,
36 MaxCorridorLength, MinCorridorLength,
37 MaxRoomLength, MinRoomLength,
38 MinDistanceBetweenRooms,
39 Box,
40 Boxes,
41 NoOfBoxes, NoOfCorridorBoxes,
42 CreateBoxMap ;
43
44 CONST
45 MaxBoxes = 500 ;
46 MaxX = 120 ; (* 38 ; *)
47 MaxY = 80 ; (* 24 ; *)
48
49 MaxDoorLength = 3 ;
50 MinDoorLength = 2 ;
51 CorridorWidth = 7 ; (* 4 ; *)
52 CorridorDoorLength = CorridorWidth-2 ;
53 TotalCorridorLength = (MaxX*3+MaxY*3) DIV 2 ;
54 MinDistanceBetweenCorridors = CorridorWidth ;
55 MaxCorridorLength = 70 ; (* 70 ; *)
56 MinCorridorLength = 15 ; (* 8 ; *)
57 MaxRoomLength = 13 ;
58 MinRoomLength = 6 ; (* 4 ; *)
59 MinDistanceBetweenRooms = MinRoomLength-1 ;
60
61 TYPE
62 Box = RECORD
63 x1, y1,
64 x2, y2 : CARDINAL ;
65 RoomOfBox: CARDINAL ;
66 END ;
67
68 VAR
69 (* Box 0 is the boarder of the map. *)
70 Boxes : ARRAY [0..MaxBoxes] OF Box ;
71 NoOfCorridorBoxes: CARDINAL ;
72 NoOfBoxes : CARDINAL ;
73
74
75 (*
76 CreateBoxMap - builds a map with central corridors and ajoining rooms.
77 *)
78
79 PROCEDURE CreateBoxMap ;
80
81
82 END BoxMap.