| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
- Listing:
- 1 (******************************************************************************)
- 2 (* HILBERT.MOD *)
- 3 (* *)
- 4 (* MetaWINDOW pretty graphics program *)
- 5 (* Transcribed from HILBERT.C METAGRAPHICS SOFTWARE CORPORATION (c) 1987-1989 *)
- 6 (* *)
- 7 (* PSW 06/28/91 08:30am *)
- 8 (******************************************************************************)
- 9
- 10 MODULE Hilbert;
- 11 (*
- 12 * Graphix
- 13 * Release 3.7
- 14 * (c) Copyright 1986-1992 PMI
- 15 * Green Bay, Wisconsin
- 16 * (414) 468-6040
- 17 * All rights reserved
- 18 *
- 19 *)
- 20
- 21 IMPORT GrQry;
- 22 IMPORT IO;
- 23 IMPORT Lib;
- 24 IMPORT GrConst;
- 25 IMPORT Meta;
- 26
- 27 VAR
- 28 GrafixCard,
- 29 CommPort,
- 30 xa, ya,
- 31 x, y,
- 32 ox, oy,
- 33 i, j,
- 34 h, h0,
- 35 penColr,
- 36 maxColr,
- 37 cnt: INTEGER;
- 38 vR, R1, R2: GrConst.rect;
- ***** ^ not supported yet
- 39
- 40 PROCEDURE a(i: INTEGER); FORWARD;
- 41 PROCEDURE b(i: INTEGER); FORWARD;
- 42 PROCEDURE c(i: INTEGER); FORWARD;
- 43 PROCEDURE d(i: INTEGER); FORWARD;
- 44
- 45
- 46 PROCEDURE IncPen();
- 47 BEGIN
- 48 IF (maxColr > 1) THEN
- 49 penColr := penColr + 1;
- 50 IF (penColr > maxColr) THEN
- 51 penColr := 1;
- 52 END;
- 53
- 54 Meta.PenColor(penColr);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 55 END
- 56 END IncPen;
- ***** ^ not supported yet
- 57
- 58 PROCEDURE PlotRect();
- 59 BEGIN
- 60 IncPen();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 61 Meta.PaintOval(R1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 62 END PlotRect;
- ***** ^ not supported yet
- 63
- 64 PROCEDURE Plt();
- 65 BEGIN
- 66 Meta.MoveTo(ox, oy);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 67 Meta.LineTo(x, y);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 68 IncPen();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 69 ox := x;
- 70 oy := y;
- 71 END Plt;
- ***** ^ not supported yet
- 72
- 73 PROCEDURE a(i: INTEGER);
- 74 BEGIN
- 75 IF (i > 0) THEN
- 76 d(i-1); x := x-h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 77 a(i-1); y := y-h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 78 a(i-1); x := x+h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 79 b(i-1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 80 END
- 81 END a;
- ***** ^ not supported yet
- 82
- 83 PROCEDURE b(i: INTEGER);
- 84 BEGIN
- 85 IF (i > 0) THEN
- 86 c(i-1); y := y+h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 87 b(i-1); x := x+h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 88 b(i-1); y := y-h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 89 a(i-1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 90 END
- 91 END b;
- ***** ^ not supported yet
- 92
- 93
- 94 PROCEDURE c(i: INTEGER);
- 95 BEGIN
- 96 IF (i > 0) THEN
- 97 b(i-1); x := x+h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 98 c(i-1); y := y+h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 99 c(i-1); x := x-h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 100 d(i-1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 101 END;
- 102 END c;
- ***** ^ not supported yet
- 103
- 104 PROCEDURE d(i: INTEGER);
- 105 BEGIN
- 106 IF (i > 0) THEN
- 107 a(i-1); y := y-h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 108 d(i-1); x := x-h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 109 d(i-1); y := y+h; Plt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 110 c(i-1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 111 END;
- 112 END d;
- ***** ^ not supported yet
- 113
- 114 BEGIN
- 115 (* init the system *)
- 116 GrQry.GrQuery(GrafixCard, CommPort);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 117
- 118 i := Meta.InitGrafix(-GrafixCard);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 119
- 120 IF (i # 0) THEN
- 121 (* Display reason for no go *)
- 122 GrQry.GrInitErr(GrafixCard, CommPort, i);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 123 END;
- 124
- 125 (* switch to graphics page *)
- 126 Meta.SetDisplay(GrConst.GrafPg0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 127
- 128 (* find number of colors supported *)
- 129 maxColr := Meta.QueryColors();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 130
- 131 (* set virtual coordinate system *)
- 132 Meta.SetRect(vR, 0, 0, 256, 256);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 133 Meta.VirtualRect(vR);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 134
- 135 LOOP
- 136 IF (maxColr > 1) THEN
- 137 Meta.RasterOp(GrConst.zREPz)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 138 ELSE
- 139 Meta.RasterOp(GrConst.zXORz);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 140 Meta.PenColor(GrConst.White)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 141 END;
- 142
- 143 (* do that hilbert thing *)
- 144 Meta.EraseRect(vR);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 145
- 146 FOR cnt := 0 TO 4 DO
- 147 i := 0;
- 148 h0 := 256;
- 149 h := h0;
- 150 xa := h DIV 2;
- 151 ya := xa;
- 152
- 153 WHILE (h > 4) DO
- 154 i := i+1;
- 155 h := h DIV 2;
- 156 xa := xa + (h DIV 2);
- 157 ya := ya + (h DIV 2);
- 158 x := xa;
- 159 y := ya;
- 160 ox := xa;
- 161 oy := ya;
- 162 a(i)
- ***** ^ not supported yet
- ***** ^ not supported yet
- 163 END;
- 164
- 165 (* stop if key pressed *)
- 166 IF (IO.KeyPressed()) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 167 EXIT
- 168 END
- 169 END;
- 170
- 171 (* ye old bouncing box gizmo *)
- 172 Meta.RasterOp(GrConst.zREPz);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 173
- 174 FOR cnt := 4 TO 0 BY -1 DO
- 175 (* make a pseudorandom number *)
- 176 i := INTEGER(Lib.RANDOM(30)) + 12;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 177
- 178 IF (cnt MOD 2) # 0 THEN
- 179 xa := i DIV 2;
- 180 ya := i DIV 3
- 181 ELSE
- 182 xa := i DIV 3;
- 183 ya := i DIV 2
- 184 END;
- 185
- 186 Meta.SetRect(R1, 0, 0, i-6, i-6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 187
- 188 FOR j := 256 TO 0 BY -1 DO
- 189 PlotRect();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 190 IF ((R1.Xmax > vR.Xmax) OR (R1.Xmin < vR.Xmin)) THEN (* flip x delta *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 191 xa := INTEGER(BITSET(xa) / BITSET(-1))
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 192 END;
- 193 IF ((R1.Ymax > vR.Ymax) OR (R1.Ymin < vR.Ymin)) THEN (* flip y delta *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 194 ya := INTEGER(BITSET(ya) / BITSET(-1))
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 195 END;
- 196 Meta.OffsetRect(R1,xa,ya);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 197
- 198 IF (IO.KeyPressed()) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 199 EXIT
- 200 END
- 201 END
- 202 END;
- 203
- 204 Meta.EraseRect(vR); (* tunnel thing *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 205 Meta.RasterOp(GrConst.zREPz);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 206
- 207 FOR cnt := 0 TO 16 DO
- 208 Meta.SetRect(R1, 124,124,132,132);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 209 Meta.SetRect(R2, 124,124,132,132);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 210 Meta.PenColor(GrConst.White);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 211
- 212 FOR i := 0 TO 32 DO
- 213 IncPen();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 214 Meta.FrameRect(R1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 215 Meta.InsetRect(R1,-4,-4)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 216 END;
- 217 Meta.PenColor(GrConst.Black);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 218
- 219 FOR i := 0 TO 32 DO
- 220 Meta.FrameRect(R2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 221 Meta.InsetRect(R2,-4,-4)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 222 END;
- 223
- 224 IF IO.KeyPressed() THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 225 EXIT
- 226 END
- 227 END;
- 228
- 229 Meta.PenColor(GrConst.White);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 230 IF (IO.KeyPressed()) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 231 EXIT
- 232 END
- 233 END; (* only exits from kbhit *)
- 234
- 235 GrQry.GrQuit('', 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 236 END Hilbert.
- 219 errors
|