Skip to content
Snippets Groups Projects
Commit 44ac96db authored by ram's avatar ram
Browse files

Initial revision

parent 34c13450
No related branches found
No related tags found
No related merge requests found
Showing
with 7285 additions and 0 deletions
Package Name:
DEMOS
Description:
Graphics demonstration programs for CMU Common Lisp using version 11 of the
X Window System.
Author:
CMU Common Lisp Group.
Maintainer:
CMU Common Lisp Group.
Address:
Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
Net Address:
slisp-group@b
Copyright Status:
Public Domain.
Files:
demos.lisp, demos.fasl, demos.catalog.
How to Get:
The following unix command will copy the pertinent files into directory
<spec>:
cp /afs/cs.cmu.edu/project/slisp/library/demos/* <spec>
Portability:
Should run in any Common Lisp supporting CLX V11R3.
Instructions:
The function DEMOS:DO-ALL-DEMOS will run through each of the demos once, and
the function DEMOS:DEMO will present a menu of all the demos.
Name:
Follow Mouse.
Package Name:
HEMLOCK
Description:
This Hemlock customization causes Hemlock's current window to be set to
whatever Hemlock window the mouse enters, except the echo area.
Author:
Todd Kaufmann, modified by Dave Touretzky.
Maintainer:
Todd Kaufmann.
Address:
Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
Net Address:
Todd.Kaufmann@CS.CMU.EDU
Copyright Status:
Public Domain.
Files:
follow-mouse.lisp, follow-mouse.fasl, follow-mouse.catalog.
How to Get:
The following unix command will copy the pertinent files into directory
<spec>:
cp /afs/cs.cmu.edu/project/slisp/library/follow-mouse/* <spec>
Portability:
This should work in any Common Lisp supporting Hemlock and CLX V11R3.
Instructions:
Load the fasl file into your editor Lisp. A value of T for the hemlock
variable "Follow Mouse To Read-Only Buffers", which is the default, means
follow mouse is on. Anything else means hemlock will behave normally.
Bugs:
A few more PROMPT-FOR-... functions need to be modified. They are mentioned
in the source code.
Package Name:
HIST
Description:
Simple histogram facility using Format strings for output.
Author:
Scott E. Fahlman
Address:
Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
Net Address:
Scott.Fahlman@CS.CMU.EDU
Copyright Status:
Public Domain.
Files:
hist.lisp, hist.fasl, hist.catalog
How to Get:
The following unix command will copy the pertinent files into directory
<spec>.
cp /afs/cs.cmu.edu/project/slisp/library/hist/* <spec>
Portability:
Should run in any legal Common Lisp.
Instructions:
Hist is a macro of form (HIST (min max [bucket-size]) . body)
Creates a histogram with buckets of the specified size (defaults to 1),
spanning the range from Low (inclusive) to High (exclusive), with two
additional buckets to catch values below and above this range. The body is
executed as a progn, and every call to Hist-Record within the body provides a
value for the histogram to count. When Body exits, the histogram is printed
out and Hist returns Nil.
A simple example:
(hist (0 10) (dotimes (i 1000) (random 10)))
This example may make the RANDOM distribution look more normal:
(hist (0 10 2) (dotimes (i 1000) (random 10)))
This example will show you overflow buckets:
(hist (2 12) (dotimes (i 1000) (random 15)))
Wish List:
Some sort of automatic scaling for the number and size of buckets would be
nice, if the user chooses not to supply these. This would probably require
running the body twice, once to determine the spread of values, and again to
actually produce the histogram.
Name:
OPS
Package Name:
OPS
Description:
Interpreter for Ops5, a programming language for production systems.
Author:
Charles L. Forgy. Ported to Common lisp by George Wood and Jim Kowalski.
CMU Common Lisp mods by Dario Guise, Skef Wholey, and Dan Kuokka.
Maintainer:
CMU Common Lisp Group.
Net Address:
slisp-group@b
Copyright Status:
Public domain.
Files:
ops.lisp, ops-backup.lisp, ops-compile.lisp, ops-io.lisp, ops-main.lisp,
ops-match.lisp, ops-rhs.lisp, ops-util.lisp, ops.catalog, ops-demo-mab.lisp,
ops-demo-ttt.lisp, and binaries.
How to Get:
The following unix command will copy the pertinent files into directory
<spec>.
cp /afs/cs.cmu.edu/project/slisp/library/ops/* <spec>
Portability:
Should run in any legal Common Lisp implementation.
Instructions:
From Lisp, load "ops" and then go into the OPS package with (in-package
'ops). Now you can load your OPS5 code or start typing in productions.
There are two demos -- interactive tic-tac-toe and the monkey and banana
problem. To run the former just load it and call RUN. For the latter, first
enter "(make start 1)" and then call RUN.
See the OPS5 User's Manual, July 1981, by Forgy, CMU CSD.
Bugs:
This has been put in its own package, but only a few interfaces have been
exported. You must run in the ops package.
Package Name:
PROFILE
Description:
Provides macros to do simple code profiling things.
Author:
Skef Wholey
Rob MacLachlan
Address:
Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
Net Address:
ram@cs.cmu.edu
Copyright Status:
Public Domain
Files:
profile.lisp, profile.fasl, profile.doc, profile.catalog
How to Get:
The following unix command will copy the pertinent files into directory
<spec>:
cp /afs/cs.cmu.edu/project/slisp/library/profile/* <spec>
Portability:
Should run in any Common Lisp. Someone porting this may want to change a
few things mentioned in profile.lisp to tune it to another implementation.
Instructions:
See the file profile.doc for details.
Name:
PSgrapher
Description:
The PSgrapher is a set of Lisp routines that can be called to produce
Postscript commands that display a directed acyclic graph.
Author:
Joseph Bates. Skef put the whole thing in the PSGRPAPH package and added
functionality which allows the user to specify EQ, EQUAL, or EQUALP as the
node equivalence function. Bill made all exported symbols have stars on them.
Address:
Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
Net Address:
Joseph.Bates@CS.CMU.EDU
Copyright Status:
Public Domain.
Files:
psgraph.lisp, psgraph.fasl, psgraph.doc, psgraph.log, psgraph.catalog
How to Get:
The following unix command will copy the pertinent files into directory
<spec>.
cp /afs/cs.cmu.edu/project/clisp/library/psgraph/* <spec>
Portability:
Should run in any legal Common Lisp. Requires Postscript for printing.
Instructions:
See psgraph.doc.
Bugs:
This code blindly outputs what the user gives it as node labels. It should
run through the output escaping any PS control characters. For example, if
node labels contain parentheses, your output PS file will not print.
Examples:
Skef Wholey submitted this as a reasonable example:
;;; I use this in my compiler so I can look at code trees without
;;; crawling around them in the inspector. The postsript previewer
;;; groks the generated ps file, which is bitchin' marvy.
(defun code-graph-to-file (s file &optional shrink insert)
(let ((psgraph:*fontname* "Times-Roman")
(psgraph:*fontsize* 8)
(psgraph:*second-fontname* "Times-BoldItalic")
(psgraph:*second-fontsize* 6)
(psgraph:*boxgray* "0")
(psgraph:*edgegray* "0")
(psgraph:*extra-x-spacing* 30))
(with-open-file (*standard-output* file
:direction :output
:if-exists :supersede)
(psgraph:psgraph s #'psg-children #'psg-info shrink insert #'eq))))
DESCRIPTION OF THE CMU COMMON LISP LIBRARY AND CATALOG ENTRY FORMAT.
The CMU Common Lisp library contains a variety of useful or interesting
software packages written by users of CMU Common Lisp. Each entry is contained
in its own subdirectory. The CATALOG.TXT describes every entry in the library.
Two subdirectories are for library maintainers, library-broken and
library-maintenance.
To submit a program for inclusion in the library, send mail to Gripe
pointing to the relevant files and providing the information for the
catalog entry in the format described below. The library maintainers will
verify that the program runs as documented in the current Lisp, has no
crippling bugs, and that the functionality is not duplicated in some other
program; then we will add the program to the library. Programs that are
made obsolete by later submissions may be dropped from the library, after
due notice is given to the user community. Some programs may be deemed so
useful that they will be included in the standard CMU Common Lisp system.
All source files must be included for each software package in the library.
Whenever possible, a program should be submitted as a single large file
rather than as a collection of smaller files; this will help to minimize
version-control problems.
Note: We plan to distribute this software freely over the Arpanet and we
may set up some mechanism to provide non-arpanet users with tapes. We can
in general accept only public-domain code (anything with no copyright
notice in the source will be assumed to be in the public domain) and code
for which Carnegie-Mellon University holds the copyright. If you have any
code of commercial value, the copyright system provides little real
protection in any case.
Bugs in library programs not listed in the "bugs" section of the program's
description should be reported to the maintainer listed below (or to the
author if there is no maintainer), with CC to Gripe.
Send any questions or comments to Gripe.
CATALOG ENTRY FORMAT FOR CATALOG.TXT.
Each entry is on a separate page, separated by the page mark Control-L.
Each entry consists of fields. Each new field begins on a fresh line with a
field name terminated by a colon. Then on a new line, indented at least one
space, is an arbitrary amount of text. This somewhat rigid format is designed
to make it easy to build various sorts of software to automatically manipulate
catalogs, but the indentation is simply a convenience for paragraph
manipulation and filling commands in the editor. The field names are sensitive
to spelling, but insensitive to case and extra whitespace.
The following is a specification of the possible fields in the catalog format:
Name: or
Module Name:
This specifies the name of the program or set of programs. If the supplier
of the entry does not specify a Package Name, then this is the package in which
the code lives.
Package Name:
If the programs are loaded into a package of their own, this is the name of
that package. If the supplier of the entry does not specify a Name or Module
Name, the package name will be used as the name for everything.
Description:
This is a brief description of what the program does.
Author:
This is the name of the author, or "anonymous".
Maintainer:
This is the name of the current maintainer, if different from the author.
If a program is not being maintained by anyone, the Maintainer is "none".
Address: or
Address of Author: or
Address of Maintainer:
This is the physical mailing address of the author or maintainer. If the
field is just "address", it is assumed to be the maintainer if one is
specified, and the author otherwise.
Net Address: or
Net Address of Author: or
Net Address of Maintainer:
This is a network address that can be reached from the arpanet.
Copyright Status:
This is "Public domain.", or some sort of copyright notice.
Files:
This is a list of the files that constitute this facility. For example, a
system named "Foo" may be distributed as files "foo.lisp", "foo.fasl", and
(optionally) "foo.doc" or "foo.PS" for documentation. In order to minimize
maintenance headaches and encourage people to build on the work of others, we
want all programs in the library to include complete sources.
How to Get:
This can either be a shell command using such programs as lcp or cp, or
there may be a .cmd file that will copy all the sources, binaries, catalog, and
log files to the user's current directory. This .cmd file will try to preserve
write date (such as using -p with cp).
Portability:
If the program will run in any legal Common Lisp, say so. If there are
known dependencies on CMU Common Lisp specific or Mach/RT specific features,
describe them here. Programs relying on CLX, CLOS, etc. should be considered
to have a high expectation of portability.
Dependencies:
If the program requires other library packages not built into the standard
CMU Common Lisp core image, list those other packages here.
Instructions:
Place here any instructions for use that are too lengthy to be mere
documentation strings, but that are not lengthy enough to deserve a separate
document.
Recent Changes:
What is different between this version and the one that preceded it, if any.
(May go back several versions at the author's discretion.)
Bugs:
Describe here any known bugs or treacherous features.
Future Plans:
Describe here any improvements planned by the author.
Wish List:
Describe here any desirable features that the author does not plan to work
on in the near future.
Notes:
This is anything else that users or potential users ought to know about.
This diff is collapsed.
This diff is collapsed.
Package Name:
DEMOS
Description:
Graphics demonstration programs for CMU Common Lisp using version 11 of the
X Window System.
Author:
CMU Common Lisp Group.
Maintainer:
CMU Common Lisp Group.
Address:
Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
Net Address:
slisp-group@b
Copyright Status:
Public Domain.
Files:
demos.lisp, demos.fasl, demos.catalog.
How to Get:
The following unix command will copy the pertinent files into directory
<spec>:
cp /afs/cs.cmu.edu/project/slisp/library/demos/* <spec>
Portability:
Should run in any Common Lisp supporting CLX V11R3.
Instructions:
The function DEMOS:DO-ALL-DEMOS will run through each of the demos once, and
the function DEMOS:DEMO will present a menu of all the demos.
This diff is collapsed.
Name:
Follow Mouse.
Package Name:
HEMLOCK
Description:
This Hemlock customization causes Hemlock's current window to be set to
whatever Hemlock window the mouse enters, except the echo area.
Author:
Todd Kaufmann, modified by Dave Touretzky.
Maintainer:
Todd Kaufmann.
Address:
Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
Net Address:
Todd.Kaufmann@CS.CMU.EDU
Copyright Status:
Public Domain.
Files:
follow-mouse.lisp, follow-mouse.fasl, follow-mouse.catalog.
How to Get:
The following unix command will copy the pertinent files into directory
<spec>:
cp /afs/cs.cmu.edu/project/slisp/library/follow-mouse/* <spec>
Portability:
This should work in any Common Lisp supporting Hemlock and CLX V11R3.
Instructions:
Load the fasl file into your editor Lisp. A value of T for the hemlock
variable "Follow Mouse To Read-Only Buffers", which is the default, means
follow mouse is on. Anything else means hemlock will behave normally.
Bugs:
A few more PROMPT-FOR-... functions need to be modified. They are mentioned
in the source code.
;;; -*- Mode: Lisp; Package: HEMLOCK-INTERNALS -*-
(in-package "HEMLOCK-INTERNALS")
;;; todd kaufmann 24 mar 88
;;; because we will have lots of windows, with users moving between them lots,
;;; we would like the window the mouse is in to be the one input goes to.
;;;
;;; also, this is more in line with the way most X windows work
;;; (unless you like to use focus)
;;; Modified by Dave Touretzky 5/23/88 to fix incremental search problem,
;;; to change windows upon leaving the echo area if the mouse moves
;;; while we're prompting for input, and to select the correct window
;;; when we split a window, based on where the mouse ends up.
;;; Bugs:
;;; - a few more prompt-for-* functions need to be modified. they're
;;; flagged below.
(defhvar "Follow Mouse to Window"
"When T, the current window becomes the one the mouse enters; when NIL,
behaves the old way"
:value T)
(defhvar "Follow Mouse To Read-only Buffers"
"Whether to follow the mouse to Read-only buffers or not"
:value T)
(defvar *last-window-mouse-entered* nil) ;set to the most recent LEGAL window entered
(defun change-to-current-entered-window (window)
"Make the buffer the mouse has moved to be the current buffer."
(let ((buffer (window-buffer window)))
(when
(and *in-the-editor*
(value ed::follow-mouse-to-window)
;; don't move cursor to menus
(not (string= (buffer-major-mode buffer) "HMenu"))
;; don't move TO echo area
(not (eq buffer *echo-area-buffer*))
;; can move to read-only buffers if user says it's okay
(if (buffer-writable buffer) t
(value ed::follow-mouse-to-read-only-buffers))
;; if we get here, this is a valid window to move to: remember it
(setf *last-window-mouse-entered* window)
;; but don't move OUT of the echo area if it's currently prompting.
(not (eq (current-window) *echo-area-window*))
;; and don't move out of current window during an incremental search
(not *during-incremental-search*)
;; Make sure it's not a random typeout buffer.
(member window *window-list*)
)
(setf (current-window) window
(current-buffer) buffer
*last-window-mouse-entered* nil))))
(add-hook ed::enter-window-hook 'change-to-current-entered-window)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; If the user is being prompted in the echo area and moves the
;;; mouse, we can't switch windows. So remember where the mouse
;;; has gone to, and switch when he leaves the echo area buffer.
(defun change-windows-if-mouse-moved ()
(when (and *last-window-mouse-entered*
(not (eq (current-window) *last-window-mouse-entered*)))
(change-to-current-entered-window *last-window-mouse-entered*)))
;from echo.lisp
(defun parse-for-something ()
(display-prompt-nicely)
(let ((start-window (current-window)))
(move-mark *parse-starting-mark* (buffer-point *echo-area-buffer*))
(setf (current-window) *echo-area-window*)
(unwind-protect
(use-buffer *echo-area-buffer*
(recursive-edit nil))
(setf (current-window) start-window)
(change-windows-if-mouse-moved)))) ; <--- here's the change
;---> Note: must make the same change to the following:
; prompt-for-y-or-n
; prompt-for-character*
; prompt-for-key
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Fix for the problem of switching buffers in the middle of an
;;; incremental search.
;;;
;;; Modify %i-search from searchcoms.lisp to bind a global variable
;;; hi::*during-incremental-search* to T. Check for this in body of
;;; change-to-current-entered-window above.
(defvar *during-incremental-search* nil)
(in-package "HEMLOCK")
(defun %i-search (string point trailer direction failure)
(unwind-protect ;<---- here's the change
(do* ((hi::*during-incremental-search* t) ;<---- here's the change
(curr-point (copy-mark point :temporary))
(curr-trailer (copy-mark trailer :temporary))
(next-char (get-key-event *editor-input* t)
(get-key-event *editor-input* t)))
(nil)
(case (%i-search-char-eval next-char string point trailer direction failure)
(:cancel
(%i-search-echo-refresh string direction failure)
(unless (zerop (length string))
(i-search-pattern string direction)))
(:return-cancel
(unless (zerop (length string)) (return :cancel))
(beep))
(:control-g
(when failure (return :control-g))
(%i-search-echo-refresh string direction nil)
(unless (zerop (length string))
(i-search-pattern string direction))))
(move-mark point curr-point)
(move-mark trailer curr-trailer))
(hi::change-windows-if-mouse-moved))) ;<---- here's the change
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Fix Split Window to not change the current window.
;;; That way, if the mouse is still in the current window,
;;; everything's fine. If the mouse ended up in the new
;;; window, a mouse-entered-window event will handle the
;;; change to the new window.
; From filecoms.lisp:
(defcommand "Split Window" (p)
"Make a new window by splitting the current window.
The new window is made the current window and displays starting at
the same place as the current window."
"Create a new window which displays starting at the same place
as the current window."
(declare (ignore p))
(let ((new (make-window (window-display-start (current-window)))))
(unless new (editor-error "Could not make a new window."))
; (setf (current-window) new) <--- commented out this line
))
;;; -*- Mode: Lisp; Package: Sample-Brains; Log: feebs.log -*-
;;;
;;; Some Feeb brains.
;;; Written by Skef Wholey and Scott Fahlman.
;;;
;;; The file Feebs.Lisp contains some feebs that are built-in for noise
;;; purposes while running: RANDOM-BRAIN, WANDERING-BRAIN, and
;;; CONSERVATIVE-BRAIN. This file contains some other simply examples of
;;; feebs.
;;;
(in-package "SAMPLE-BRAINS" :use '("LISP" "FEEBS"))
;;; Experimental brain. Like the built-in conservative brain, but without the
;;; range limitation.
;;;
(defun cautious-brain (status proximity vision vision-left vision-right)
(declare (ignore vision-left vision-right))
(let ((stuff (my-square proximity)))
(cond ((and (consp stuff) (member :mushroom stuff :test #'eq))
:eat-mushroom)
((and (consp stuff) (member :carcass stuff :test #'eq))
:eat-carcass)
((and (ready-to-fire status)
(> (energy-reserve status) 30)
(dotimes (index (line-of-sight status))
(let ((stuff (aref vision index)))
(if (listp stuff)
(if (dolist (thing stuff)
(if (feeb-image-p thing)
(return t)))
(return t))
(if (feeb-image-p stuff)
(return t))))))
:flame)
((and (not (eq (left-square proximity) :rock))
(> 0.2 (random 1.0)))
:turn-left)
((and (not (eq (right-square proximity) :rock))
(> 0.2 (random 1.0)))
:turn-right)
((not (ready-to-fire status))
:wait)
((> (line-of-sight status) 0)
:move-forward)
((not (eq (left-square proximity) :rock))
:turn-left)
((not (eq (right-square proximity) :rock))
:turn-right)
(t
:turn-around))))
(define-feeb "Cau1" 'cautious-brain)
(define-feeb "Cau2" 'cautious-brain)
(define-feeb "Cau3" 'cautious-brain)
[Name] FEEBS
[Description] "Planet of the Feebs is a simulation game that is
intended as a training aid for beginning programmers in
Common Lisp. It is loosely based on the "Maze War" game,
written by Jim Guyton, Bruce Malasky, and assorted others
at Xerox PARC. In "Planet of the Feebs", however, the
players do not control their creatures by hand. Instead,
they supply programs which control the creatures as they
move around the maze trying to zap one another. The game
presents an open-ended challenge, and advanced players may
find themselves reaching deep into the AI bag of tricks as
they try to build ever more clever and adaptable creatures.
[Author] Skef Wholey, Scott Fahlman, Dan Kuokka, Jim Healy
[Maintainer] Members of the CMU Common Lisp Group.
[Address] Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
[Net Address] Slisp@C.CS.CMU.EDU (at CMU send mail to Gripe)
[Copywrite Status] Public domain.
[Files] feebs.lisp, feebs.fasl, feebs.catalog, feebs.mss,
feebs.log, brains.lisp, brains.fasl, mazes.lisp
[How to Get] source /../spice/usr/slisp/library/rt/feebs/get-feebs.cmd
[Portability] Dependent on Version 10 of the X Window Manager.
[Instructions] Load feebs.fasl and brains.fasl.
call FEEBS:FEEBS.
[Wish List] Add egocentric display for one selected feeb.
This diff is collapsed.
/usr2/lisp/library/rt/feebs/feebs.lisp, 11-Oct-87 16:33:43, Edit by Chiles.
Made FEEBS bind, instead of set, *single-step*,*delay*,
*feep-dead-feebs*, and *continue*. These values were being retained
between runs.
/usr2/lisp/library/rt/feebs/feebs.lisp, 11-Oct-87 15:35:47, Edit by Chiles.
Fixed X interaction by calling X:OPEN-CONSOLE in INIT-GRAPHICS. Also,
set bordercolor and background parameters in INIT-GRAPHICS. Made
KILL-FEEB look at the value of *feep-dead-feebs*.
/usr2/lisp/library/rt/feebs/brains.lisp, 11-Oct-87 12:01:50, Edit by Chiles.
Written by Skef and Scott. This is just a file of sample feebs that are
pretty dumb.
/usr2/lisp/library/rt/feebs/mazes.lisp, 11-Oct-87 11:57:15, Edit by Chiles.
Created by Jim Healy, July 1987. This file contains some sample mazes
with various curious properties.
/usr2/lisp/library/rt/feebs/feebs.lisp, 11-Oct-87 11:53:54, Edit by Chiles.
No time stamp for this either, but it is close to the previous line's.
;;; Modifications by Jim Healy:
;;;
;;; Ported the graphics to the IBM RT PC using the X window manager.
;;; Added functions to create and store bitmaps for X.
;;; Added event-handling routines to catch incoming events from the
;;; X server and redisplay the windows if exposed.
;;; Changed :single-step option to work by clicking a mouse button.
;;; Added keypress features to quit the game prematurely (q), jump
;;; into single-step mode (s), and go back to automatic mode (a).
;;; Added the neat "Planet of the Feebs" banner at the top.
;;; Added feature to zap windows at end of game by clicking a mouse
;;; button.
;;; Fixed the disembodied periscopes bug.
/usr2/lisp/library/rt/feebs/feebs.lisp, 11-Oct-87 11:52:55, Edit by Chiles.
No time stamp on this entry.
;;; Modifications by Dan Kuokka:
;;;
;;; Built the interface to a generalized set of graphics primitives.
;;; Wrote rotate-bitmap.
/usr2/lisp/library/rt/feebs/feebs.lisp, 11-Oct-87 11:51:54, Edit by Chiles.
No time stamp on this entry either.
;;; The following by Scott Fahlman, for initial public release:
;;;
;;; Installed CHANCE macro to speed up random events.
;;; Modified points for being killed from -5 to -2.
;;; When you zap yourself, you get no points for the kill.
;;; Eliminated random length of game. Now *GAME-LENGTH* = 1000.
;;; Modified default maze slightly so that no two entry points are
;;; line of sight, regardless of how the feebs are facing.
;;; Changed directions from keywords to constants, with integer values:
;;; north = 1, east = 2, etc.
;;; Randomize initial entry points for feebs.
;;; Display more interesting stuff in text area: score, energy, last move.
;;; Keep energy in range 0 to 200 always, fix bug that caused any eating
;;; to push energy to maximum.
;;; Display kills in status area, along with score.
;;; ABORTED status field was not being maintained.
;;; Install a smoother function for aborting moves of slow feebs.
;;; Add single-step and slow motion.
;;; Put in proximity sense, start vision array in space in front of the
;;; the feeb's current location, going forward, left, or right from there.
;;; Store the appropriate image list in each maze cell, eliminating the
;;; IMAGIFY operations. Add a pointer from the feeb-image back to the
;;; full feeb-structure.
;;; Allow *maze-i-size* and *maze-j-size* to be different.
;;; Fixed a couple of bugs in fireball motion.
;;; Feebs running into fireballs get zapped.
;;; Make sure image is updated between action and redisplay.
;;; Queue redisplay for a feeb's old square on every move.
;;; Improve mushroom image to not hit edges of square.
;;; Improve fireball display to show direction of travel.
;;; On reflection, update fireball DIRECTION as well as DI, DJ.
;;; Display current turn. Improve kludgy number printing.
;;; Display periscope-like appendage when feeb is peeking.
;;; Do not execute peek command if the feeb is facing a rock wall.
;;; When a feeb was peeking last move, queue the forward square for
;;; redisplay to get rid of the periscope.
;;; Set up auto-feeb creation and add some stupid auto-feebs.
;;; Remove the terse printing function for the status structure to make
;;; it somewhat easier to debug things.
;;; Fixed a bug in the DI and DJ macros.
/usr2/lisp/library/rt/feebs/feebs.lisp, 11-Oct-87 11:50:10, Edit by Chiles.
Created by Skef Wholey -- No time stamp.
This diff is collapsed.
This diff is collapsed.
Package Name:
HIST
Description:
Simple histogram facility using Format strings for output.
Author:
Scott E. Fahlman
Address:
Carnegie-Mellon University
Computer Science Department
Pittsburgh, PA 15213
Net Address:
Scott.Fahlman@CS.CMU.EDU
Copyright Status:
Public Domain.
Files:
hist.lisp, hist.fasl, hist.catalog
How to Get:
The following unix command will copy the pertinent files into directory
<spec>.
cp /afs/cs.cmu.edu/project/slisp/library/hist/* <spec>
Portability:
Should run in any legal Common Lisp.
Instructions:
Hist is a macro of form (HIST (min max [bucket-size]) . body)
Creates a histogram with buckets of the specified size (defaults to 1),
spanning the range from Low (inclusive) to High (exclusive), with two
additional buckets to catch values below and above this range. The body is
executed as a progn, and every call to Hist-Record within the body provides a
value for the histogram to count. When Body exits, the histogram is printed
out and Hist returns Nil.
A simple example:
(hist (0 10) (dotimes (i 1000) (random 10)))
This example may make the RANDOM distribution look more normal:
(hist (0 10 2) (dotimes (i 1000) (random 10)))
This example will show you overflow buckets:
(hist (2 12) (dotimes (i 1000) (random 15)))
Wish List:
Some sort of automatic scaling for the number and size of buckets would be
nice, if the user chooses not to supply these. This would probably require
running the body twice, once to determine the spread of values, and again to
actually produce the histogram.
;;; -*- Mode: Lisp; Package: Hist; Log: Hist.Log -*-
;;;
;;; This code has been placed in the public domain by the author.
;;; It is distributed without warranty of any kind.
;;;
;;; Description: Simple Histogram facility. Just prints out the result
;;; using Format. No fancy graphics.
;;;
;;; Author: Scott E. Fahlman
;;;
;;; Current maintainer: Scott E. Fahlman
;;;
;;; Address: Carnegie-Mellon University
;;; Computer Science Department
;;; Pittsburgh, PA 15213
;;;
;;; Net address: Scott.Fahlman@cmu-cs-a
;;;
;;; Copyright status: Public domain.
;;;
;;; Compatibility: Should run in any legal Common Lisp implementation.
;;;
;;; Dependencies: Depends only on standard Common Lisp facilities.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package "HIST")
(export '(hist hist-record))
;;; Uses a bunch of specials for communication.
(proclaim '(special *hist-lower-limit*
*hist-upper-limit*
*hist-bucket-size*
*hist-nbuckets*
*hist-array*))
(defconstant hist-limit 60
"The maximum number of #'s that are to be printed.")
(defmacro hist ((low high &optional (bucket-size 1))
&body body)
"Format is (HIST (low high [bucket-size]) . body).
Creates a histogram with buckets of the specified size (defaults to 1),
spanning the range from Low (inclusive) to High (exclusive), with two
additional buckets to catch values below and above this range.
The body is executed as a progn, and every call to Hist-Record within
the body provides a value for the histogram to count.
When Body exits, the histogram is printed out and Hist returns Nil."
`(let* ((*hist-lower-limit* ,low)
(*hist-upper-limit* ,high)
(*hist-bucket-size* ,bucket-size)
(*hist-nbuckets*
(+ 2 (ceiling (- *hist-upper-limit* *hist-lower-limit*)
*hist-bucket-size*)))
(*hist-array* (make-array *hist-nbuckets* :initial-element 0)))
(progn ,@body)
(let ((biggest 0) (scale 1))
(dotimes (b (- *hist-nbuckets* 2))
(when (> (svref *hist-array* b) biggest)
(setq biggest (svref *hist-array* b))))
(when (> biggest hist-limit)
(setq scale (ceiling biggest hist-limit))
(format t "~&Each \"#\" equals ~S units. The \".\" indicates a fraction."
scale))
(format t "~&< ~S: ~12,8T~S~%"
*hist-lower-limit*
(svref *hist-array* (1- *hist-nbuckets*)))
(do ((b 0 (1+ b))
(bval *hist-lower-limit* (+ bval *hist-bucket-size*))
(bcount 0))
((= b (- *hist-nbuckets* 2)))
(setq bcount (svref *hist-array* b))
(multiple-value-bind (q r) (truncate bcount scale)
(format t "~S: ~12,8T~S~20,8T~V,1,0,'#@A~%"
bval bcount (1+ q) (if (zerop r) #\ #\.))))
(format t "> ~S: ~12,8T~S~%"
*hist-upper-limit*
(svref *hist-array* (- *hist-nbuckets* 2))))
nil))
(defun hist-record (value)
"This function should only be called within the body of a HIST form.
Increments the proper histogram counter to record this value."
(cond ((< value *hist-lower-limit*)
(incf (svref *hist-array* (1- *hist-nbuckets*))))
((>= value *hist-upper-limit*)
(incf (svref *hist-array* (- *hist-nbuckets* 2))))
(t (incf (svref *hist-array* (floor (- value *hist-lower-limit*)
*hist-bucket-size*))))))
;;; -*- Mode: Lisp; Package: library -*-
;;;
;;; This contains somewhat specific code for gathering all the pertinent
;;; .catalog files from the CMU Common Lisp Library subdirectories to
;;; construct one catalog.txt file from them.
;;;
;;; This code uses at least one implementation internal function, hacks
;;; pathnames as strings, accepts CMU Common Lisp logical names, tries
;;; to determine what a directory name looks like, uses CMU Common Lisp
;;; extensions, and generally tries not to be portable in any way.
;;;
;;; Written by Bill Chiles
;;;
(in-package "LIBRARY" :nicknames '("LIB"))
(export 'build-catalog)
(defun build-catalog (dir)
"Gather all the .catalog files from the subdirectories of dir, bashing them
into a file named \"new-catalog.txt\" in dir. The argument must be a
logical name or end with a slash (/)"
(with-open-file (stream (merge-pathnames dir "new-catalog.txt")
:direction :output :if-exists :new-version)
(let* ((files (catalog-files dir))
(last (car (last files))))
(dolist (f files)
(with-open-file (catalog f)
(do ((line (read-line catalog nil :eof)
(read-line catalog nil :eof)))
((eq line :eof))
(write-line line stream))
(unless (equal f last)
(format stream "~%~|~%")))))))
;;; CATALOG-FILES does a DIRECTORY (CMU Common Lisp) of dir returning a
;;; list of file names containing the string ".catalog". The directory
;;; listing may include subdirectories, but these subdirs contain only
;;; files (one of which is a catalog file). The subdirectory catalog
;;; files are included in the result list in order of the subdirectory's
;;; appearance.
;;;
(defun catalog-files (dir)
(let ((listing (directory dir))
result)
(dolist (f listing (nreverse result))
(let ((name (namestring f)))
(declare (simple-string name))
(if (directoryp f)
(dolist (f (directory name))
(let ((name (namestring f)))
(declare (simple-string name))
(when (search ".catalog" name :test #'char=)
(push name result)
(return))))
(if (search ".catalog" name :test #'char=)
(push name result)))))))
(defun directoryp (p)
(let ((p (pathname p)))
(string= (the simple-string (directory-namestring p))
(the simple-string (namestring p)))))
;;; -*- Mode: Lisp; Package: library -*-
;;;
;;; This file contains stupid code to simply compile all the library entries.
;;;
;;; Written by Blaine Burks.
;;;
(in-package "LIBRARY" :nicknames '("LIB"))
(export '(compile-entries))
(defun compile-entries ()
(let ((lib-directory (directory ed::*lisp-library-directory*)))
(dolist (lib-spec lib-directory)
(let* ((path-parts (pathname-directory lib-spec))
(last (svref path-parts (1- (length path-parts))))
(raw-pathname (merge-pathnames last lib-spec)))
(when (and (ed::directoryp lib-spec)
(probe-file (merge-pathnames ".catalog" raw-pathname)))
(compile-file (merge-pathnames raw-pathname ".lisp") :error-file nil)
(write-string last))))))
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment