]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gm2/projects/pim/run/pass/random/AdvMap.def
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gm2 / projects / pim / run / pass / random / AdvMap.def
CommitLineData
a945c346 1(* Copyright (C) 2005-2024 Free Software Foundation, Inc. *)
1eee94d3
GM
2(* This file is part of Chisel.
3
4Chisel is free software; you can redistribute it and/or modify it under
5the terms of the GNU General Public License as published by the Free
6Software Foundation; either version 3, or (at your option) any later
7version.
8
9Chisel is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or
11FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12for more details.
13
14You should have received a copy of the GNU General Public License along
15with gm2; see the file COPYING. If not, write to the Free Software
16Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *)
17
18DEFINITION MODULE AdvMap ;
19
20
21EXPORT QUALIFIED Rooms, Line, DoorStatus, Door, Room, Treasure,
22 ActualNoOfRooms, MaxNoOfTreasures, MaxNoOfRooms,
23 NoOfRoomsToHidePlayers, NoOfRoomsToSpring,
24 NoOfRoomsToHideCoal, NoOfRoomsToHideGrenade,
25 ReadAdvMap, Adjacent, IncPosition,
26 FileName, MaxLengthOfFileName ;
27
28
29CONST
30 MaxNoOfRooms = 350 ;
31 MaxWallsPerRoom = 8 ;
32 MaxDoorsPerRoom = 6 ;
33 MaxNoOfTreasures = 15 ;
34 MaxLengthOfFileName = 11 ;
35 NoOfRoomsToHidePlayers = 50 ;
36 NoOfRoomsToSpring = 50 ;
37 NoOfRoomsToHideCoal = 50 ;
38 NoOfRoomsToHideGrenade = 50 ;
39
40
41TYPE
42
43 Line = RECORD
44 X1 : CARDINAL ;
45 Y1 : CARDINAL ;
46 X2 : CARDINAL ;
47 Y2 : CARDINAL
48 END ;
49
50 DoorStatus = (Open, Closed, Secret) ;
51
52 Door = RECORD
53 Position : Line ;
54 StateOfDoor : DoorStatus ;
55 LeadsTo : CARDINAL
56 END ;
57
58 TreasureInfo = RECORD
59 Xpos : CARDINAL ;
60 Ypos : CARDINAL ;
61 Rm : CARDINAL ;
62 Tweight : CARDINAL ;
63 TreasureName : ARRAY [0..12] OF CHAR
64 END ;
65
66 Room = RECORD
67 RoomNo : CARDINAL ;
68 NoOfWalls : CARDINAL ;
69 NoOfDoors : CARDINAL ;
70 Walls : ARRAY [1..MaxWallsPerRoom] OF Line ;
71 Doors : ARRAY [1..MaxDoorsPerRoom] OF Door ;
72 Treasures : BITSET ;
73 END ;
74
75
76VAR
77 ActualNoOfRooms : CARDINAL ;
78 Treasure : ARRAY [1..MaxNoOfTreasures] OF TreasureInfo ;
79 Rooms : ARRAY [1..MaxNoOfRooms] OF Room ;
80
81 FileName : ARRAY [0..MaxLengthOfFileName] OF CHAR ;
82
83
84(*
85 ReadAdvMap - read map, Name, into memory.
86 TRUE is returned if the operation was successful.
87*)
88
89PROCEDURE ReadAdvMap (Name: ARRAY OF CHAR) : BOOLEAN ;
90
91
92(*
93 Adjacent - tests to see if two rooms are Adjacent to each other.
94*)
95
96PROCEDURE Adjacent (R1, R2: CARDINAL) : BOOLEAN ;
97
98
99(*
100 IncPosition - increments the position of x, y by the direction that are facing.
101*)
102
103PROCEDURE IncPosition (VAR x, y: CARDINAL ; Dir: CARDINAL) ;
104
105
106END AdvMap.