1
0
mirror of synced 2026-01-25 12:05:41 +00:00

FILEWATCH, QIX, SOLITAIRE--rename fields that conflict with REGION and POINT (#1763)

This commit is contained in:
rmkaplan
2024-06-16 21:17:48 -07:00
committed by GitHub
parent 3e77f627a0
commit ffe99d6bcc
6 changed files with 133 additions and 119 deletions

View File

@@ -1,13 +1,13 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "XCL" BASE 10)
(FILECREATED "24-Aug-2022 07:58:48" |{DSK}<home>larry>medley>lispusers>QIX.;2| 11276
(FILECREATED "14-Jun-2024 14:54:24" |{WMEDLEY}<lispusers>QIX.;4| 12192
:CHANGES-TO (FNS QIX.IDLE)
:EDIT-BY |rmk|
:PREVIOUS-DATE "12-Aug-87 03:05:50" |{DSK}<home>larry>medley>lispusers>QIX.;1|)
:CHANGES-TO (FNS QIX.GROW)
:PREVIOUS-DATE "14-Jun-2024 14:49:48" |{WMEDLEY}<lispusers>QIX.;3|)
; Copyright (c) 1987 by Xerox Corporation.
(PRETTYCOMPRINT QIXCOMS)
@@ -18,69 +18,72 @@
(DEFINEQ
(QIX.GROW
(LAMBDA (WINDOW DONTDISMISS) (* \; "Edited 1-Aug-87 16:57 by JEFF.SHRAGER")
(* * |This| |sets| |up| \a QIX |the| |specified| |window.|
 |The| |QIX's| |parameters| |are| |defined| |at| |random,| |but| |with|
 |reasonable| |value| |ranges.| |The| |dismiss| |argument| |tell| |the| QIX
 |whether| |to| DISMISS |every| |cycle| |or| |not.|
 B\e |careful.|)
(LAMBDA (WINDOW DONTDISMISS) (* \; "Edited 14-Jun-2024 14:54 by rmk")
(* \;
 "Edited 1-Aug-87 16:57 by JEFF.SHRAGER")
(* |;;;| "This sets up a QIX the specified window. The QIX's parameters are defined at random, but with reasonable value ranges. The dismiss argument tell the QIX whether to DISMISS every cycle or not. Be careful.")
(PROG (P P2 (W (OR WINDOW (CREATEW)))
L)
(SETQ *STOP.QIXS* NIL)
(* * P |and| P2 |define| \a QIX.)
(* |;;;| "P and P2 define a QIX.")
(SETQ P (|create| QIX.POINT
X _ (RAND 1 200)
Y _ (RAND 1 100)
QX _ (RAND 1 200)
QY _ (RAND 1 100)
VH _ (RAND 1 20)
VV _ (RAND 1 20)))
(SETQ P2 (|create| QIX.POINT
X _ (RAND 1 200)
Y _ (RAND 1 100)
QX _ (RAND 1 200)
QY _ (RAND 1 100)
VH _ (RAND 1 20)
VV _ (RAND 1 20)))
(* * L |is| |the| |tail| |list.| I\t |starts| |out| |full| |of| NIL\s |and|
 |gets| |filled| |as| |the| QIX |moves.| I\t |is| |also| |inserted| |in| |it's|
 |own| |mouth| |so| |that| |the| |whole| |thing| |wraps| |around.|)
(* |;;;| "L is the tail list. It starts out full of NILs and gets filled as the QIX moves. It is also inserted in it's own mouth so that the whole thing wraps around.")
(SETQ L (APPEND (|for| X |from| 1 |to| (RAND 5 25)
|collect| (COPY '(A S D F)))
(LIST (LIST (|fetch| X P)
(|fetch| Y P)
(|fetch| X P2)
(|fetch| Y P2)))))
(LIST (LIST (|fetch| (QIX.POINT QX)
P)
(|fetch| (QIX.POINT QY)
P)
(|fetch| (QIX.POINT QX)
P2)
(|fetch| (QIX.POINT QY)
P2)))))
(RPLACD (LAST L)
L)
LOOP
(COND
(*STOP.QIXS* (RPLACD L NIL)
(RETURN NIL)))
(* * |Draw| |the| |QIX's| |head| |line.|)
(MOVETO (|fetch| X P)
(|fetch| Y P)
(* |;;;| "Draw the QIX's head line.")
(MOVETO (|fetch| (QIX.POINT QX)
P)
(|fetch| (QIX.POINT QY)
P)
W)
(DRAWTO (|fetch| X P2)
(|fetch| Y P2)
(DRAWTO (|fetch| (QIX.POINT QX)
P2)
(|fetch| (QIX.POINT QY)
P2)
1
'REPLACE W)
(* * |Move| |the| |points| |according| |to| |their| X |and| Y |velocities.|)
(* |;;;| "Move the points according to their QX and QY velocities.")
(QIX.MOVE.POINT P W)
(QIX.MOVE.POINT P2 W)
(* * |Take| \a |deep| |breath| |if| |the| |user| |asks| |you| |to.|
 |This| |slows| |things| |down.|)
(* |;;;| "Take a deep breath if the user asks you to. This slows things down.")
(OR DONTDISMISS (DISMISS))
(* * |Delete| |the| |first| |object| |on| |the| |tail| |list.|)
(* |;;;| "Delete the first object on the tail list.")
(COND
((EQ (CAAR L)
@@ -93,60 +96,63 @@
(CADDDR OLD)
1
'ERASE W))))
(* * |Replace| |the| |current| |point| |with| |the| |new| |head,| |which|
 |effectively| |adds| |it| |to| |the| |end| |of| |the| |list,| |since| |we|
 |them| |immediately| |move| |to| |the| |next| |elt| |in| |this| |circular|
 |list.|)
(* |;;;| "Replace the current point with the new head, which effectively adds it to the end of the list, since we them immediately move to the next elt in this circular list.")
(RPLACA (CAR L)
(|fetch| X P))
(|fetch| (QIX.POINT QX)
P))
(RPLACA (CDAR L)
(|fetch| Y P))
(|fetch| (QIX.POINT QY)
P))
(RPLACA (CDDAR L)
(|fetch| X P2))
(|fetch| (QIX.POINT QX)
P2))
(RPLACA (CDDDAR L)
(|fetch| Y P2))
(|fetch| (QIX.POINT QY)
P2))
(SETQ L (CDR L))
(GO LOOP))))
(QIX.IDLE
(LAMBDA (W) (* \; "Edited 24-Aug-2022 07:53 by larry")
(LAMBDA (W) (* \; "Edited 14-Jun-2024 14:49 by rmk")
(* \; "Edited 24-Aug-2022 07:53 by larry")
(* \;
 "Edited 1-Aug-87 16:58 by JEFF.SHRAGER")
(* * CLOBBER ANY OLD QIXS THAT WERE LEFT AROUND
 (WASTING SPACE) FROM BEFORE.)
(* |;;;| "CLOBBER ANY OLD QIXS THAT WERE LEFT AROUND (WASTING SPACE) FROM BEFORE.")
(AND (BOUNDP '*OLD-QIXS*)
(FOR Q IN *OLD-QIXS* DO (RPLACD Q NIL)))
(PROG (P P2 L QIXS)
(* * P |and| P2 |define| \a QIX.)
(* |;;;| "P and P2 define a QIX.")
(SETQ QIXS (|for| I |from| 1 |to| 5
|collect| (PROGN (SETQ P (|create| QIX.POINT
X _ (RAND 1 200)
Y _ (RAND 1 100)
QX _ (RAND 1 200)
QY _ (RAND 1 100)
VH _ (RAND 1 20)
VV _ (RAND 1 20)))
(SETQ P2 (|create| QIX.POINT
X _ (RAND 1 200)
Y _ (RAND 1 100)
QX _ (RAND 1 200)
QY _ (RAND 1 100)
VH _ (RAND 1 20)
VV _ (RAND 1 20)))
(* * L |is| |the| |tail| |list.| I\t |starts| |out| |full| |of| NIL\s |and|
 |gets| |filled| |as| |the| QIX |moves.| I\t |is| |also| |inserted| |in| |it's|
 |own| |mouth| |so| |that| |the| |whole| |thing| |wraps| |around.|)
(* |;;;| "L is the tail list. It starts out full of NILs and gets filled as the QIX moves. It is also inserted in it's own mouth so that the whole thing wraps around.")
(SETQ L
(APPEND (|for| X |from| 1 |to| (RAND 5 25)
|collect| (COPY '(A S D F)))
(LIST (LIST (|fetch| X P)
(|fetch| Y P)
(|fetch| X P2)
(|fetch| Y P2)))))
(LIST (LIST (|fetch| (QIX.POINT QX)
P)
(|fetch| (QIX.POINT QY)
P)
(|fetch| (QIX.POINT QX)
P2)
(|fetch| (QIX.POINT QY)
P2)))))
(RPLACD (LAST L)
L)
(LIST P P2 L))))
@@ -157,22 +163,26 @@
(SETQ P2 (CADR Q))
(SETQ L (CADDR Q))
(* * |Draw| |the| |QIX's| |head| |line.|)
(* |;;;| "Draw the QIX's head line.")
(MOVETO (|fetch| X P)
(|fetch| Y P)
(MOVETO (|fetch| (QIX.POINT QX)
P)
(|fetch| (QIX.POINT QY)
P)
W)
(DRAWTO (|fetch| X P2)
(|fetch| Y P2)
(DRAWTO (|fetch| (QIX.POINT QX)
P2)
(|fetch| (QIX.POINT QY)
P2)
1
'REPLACE W)
(* * |Move| |the| |points| |according| |to| |their| X |and| Y |velocities.|)
(* |;;;| "Move the points according to their QX and QY velocities.")
(QIX.MOVE.POINT P W)
(QIX.MOVE.POINT P2 W)
(* * |Delete| |the| |first| |object| |on| |the| |tail| |list.|)
(* |;;;| "Delete the first object on the tail list.")
(COND
((EQ (CAAR L)
@@ -186,34 +196,36 @@
1
'ERASE W))))
(* * |Replace| |the| |current| |point| |with| |the| |new| |head,| |which|
 |effectively| |adds| |it| |to| |the| |end| |of| |the| |list,| |since| |we| THEN
 |immediately| |move| |to| |the| |next| |elt| |in| |this| |circular| |list.|)
(* |;;;| "Replace the current point with the new head, which effectively adds it to the end of the list, since we THEN immediately move to the next elt in this circular list.")
(RPLACA (CAR L)
(|fetch| X P))
(|fetch| (QIX.POINT QX)
P))
(RPLACA (CDAR L)
(|fetch| Y P))
(|fetch| (QIX.POINT QY)
P))
(RPLACA (CDDAR L)
(|fetch| X P2))
(|fetch| (QIX.POINT QX)
P2))
(RPLACA (CDDDAR L)
(|fetch| Y P2))
(|fetch| (QIX.POINT QY)
P2))
(RPLACA (CDDR Q)
(CDR L)))
(GO LOOP))))
(QIX.MOVE.POINT
(LAMBDA (P W) (* |edited:| "16-May-85 00:39")
(* * |This| |guy| |updates| |the| QIX |line| |endpoints| |according| |to|
 |their| |velocities| |in| |the| X |and| Y |directions.|
 I\f |we| |hit| \a |wall,| |then| |simply| |negate| |the| |relevant| |velocity|
 |vector.|)
(LAMBDA (P W) (* \; "Edited 14-Jun-2024 14:48 by rmk")
(* |edited:| "16-May-85 00:39")
(* |;;;| "This guy updates the QIX line endpoints according to their velocities in the X and Y directions. If we hit a wall, then simply negate the relevant velocity vector.")
(PROG ((VV (|fetch| VV P))
(VH (|fetch| VH P))
(X (|fetch| X P))
(Y (|fetch| Y P)))
(X (|fetch| (QIX.POINT QX)
P))
(Y (|fetch| (QIX.POINT QY)
P)))
(PROG ((NEWX (IPLUS X VH))
(NEWY (IPLUS Y VV)))
(COND
@@ -230,8 +242,10 @@
((GREATERP NEWX (WINDOWPROP W 'WIDTH))
(SETQ NEWX (WINDOWPROP W 'WIDTH))
(SETQ VH (ITIMES -1 VH))))
(|replace| Y P NEWY)
(|replace| X P NEWX)
(|replace| (QIX.POINT QY)
P NEWY)
(|replace| (QIX.POINT QX)
P NEWX)
(|replace| VV P VV)
(|replace| VH P VH)))))
@@ -249,13 +263,12 @@
)
(DECLARE\: EVAL@COMPILE
(RECORD QIX.POINT (X Y VH VV))
(RECORD QIX.POINT (QX QY VH VV))
)
(SETQ IDLE.FUNCTIONS (CONS '("5 Qix's" 'QIX.IDLE)
IDLE.FUNCTIONS))
(PUTPROPS QIX COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE\: DONTCOPY
(FILEMAP (NIL (592 11044 (QIX.GROW 602 . 4158) (QIX.IDLE 4160 . 8972) (QIX.MOVE.POINT 8974 . 10356) (
QIX.PLAY 10358 . 11042)))))
(FILEMAP (NIL (544 12010 (QIX.GROW 554 . 4311) (QIX.IDLE 4313 . 9800) (QIX.MOVE.POINT 9802 . 11322) (
QIX.PLAY 11324 . 12008)))))
STOP