http://www.jwz.org/xscreensaver/xscreensaver-5.07.tar.gz
[xscreensaver] / hacks / munch.man
1 .de EX          \"Begin example
2 .ne 5
3 .if n .sp 1
4 .if t .sp .5
5 .nf
6 .in +.5i
7 ..
8 .de EE
9 .fi
10 .in -.5i
11 .if n .sp 1
12 .if t .sp .5
13 ..
14 .TH XScreenSaver 1 "17-Jun-97" "X Version 11"
15 .SH NAME
16 munch - munching squares screen hack
17 .SH SYNOPSIS
18 .B munch
19 [\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP]
20 [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install]
21 [\-visual \fIvisual\fP] [\-delay \fImicroseconds\fP] [\-xor] [\-noxor] [\-shift]
22 [\-noshift] [\-logminwidth \fIminimum width\fP]
23 [\-fps]
24 .SH DESCRIPTION
25 The
26 .I munch
27 program performs the munching squares hack until killed.  It picks square
28 size, position, and gravity randomly; configurable options are listed
29 below.
30 .PP
31 The munching squares hack consists of drawing Y = X XOR T for a range of X
32 and T over and over until all the possible combinations of X and T have
33 come up.  It was reportedly discovered by Jackson Wright in 1962 and took 5
34 instructions of PDP-6 code.
35 .SH OPTIONS
36 .I munch
37 accepts the following options:
38 .TP 8
39 .B \-window
40 Draw on a newly-created window.  This is the default.
41 .TP 8
42 .B \-root
43 Draw on the root window.
44 .TP 8
45 .B \-mono 
46 If on a color display, pretend we're on a monochrome display.
47 .TP 8
48 .B \-install
49 Install a private colormap for the window.
50 .TP 8
51 .B \-visual \fIvisual\fP
52 Specify which visual to use.  Legal values are the name of a visual class,
53 or the id number (decimal or hex) of a specific visual.
54 .TP 8
55 .B \-delay \fImicroseconds\fP
56 How long to wait before starting over.  Default 5000.
57 .TP 8
58 .B \-xor
59 Use the XOR drawing function.  (Default.)
60 .TP 8
61 .B \-no\-xor
62 Don't use the XOR drawing function.
63 .TP 8
64 .B \-shift
65 Start drawing the square at weird starting points.  (Default.)
66 .TP 8
67 .B \-no\-shift
68 Don't shift and start drawing the square at weird starting points.
69 .TP 8
70 .B \-logminwidth \fIminimum\-width\fP
71 The logarithm (base 2) of the minimum with of a square (must be a power of
72 2, or some parts of the square aren't.)
73 .TP 8
74 .B \-fps
75 Display the current frame rate and CPU load.
76 .SH ENVIRONMENT
77 .PP
78 .TP 8
79 .B DISPLAY
80 to get the default host and display number.
81 .TP 8
82 .B XENVIRONMENT
83 to get the name of a resource file that overrides the global resources
84 stored in the RESOURCE_MANAGER property.
85 .SH SEE ALSO
86 .BR X (1),
87 .BR xscreensaver (1),
88 .BR http://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html,
89 .BR http://www.comedia.com/Hot/jargon_3.0/JARGON_M/MUNCHSQR.HTML
90 .SH HISTORY
91 Quoted from HAKMEM, for historical interest.  As that document says, "Unless
92 otherwise stated, all computer programs are in PDP-6/10 assembly language."
93 .TP 8
94 ITEM 146: MUNCHING SQUARES
95 Another simple display program. It is thought that this was discovered by
96 Jackson Wright on the RLE PDP-1 circa 1962.
97
98 .EX
99     DATAI 2
100     ADDB 1,2
101     ROTC 2,-22
102     XOR 1,2
103     JRST .-4
104 .EE
105 .RS 8
106 2=X, 3=Y. Try things like 1001002 in data switches. This also does
107 interesting things with operations other than XOR, and rotations other 
108 than -22. (Try IOR; AND; TSC; FADR; FDV(!); ROT -14, -9, -20, ...)
109 .RE
110 .TP 8
111 ITEM 147 (Schroeppel):
112 Munching squares is just views of the graph Y = X XOR T for consecutive
113 values of T = time.
114 .TP 8
115 ITEM 148 (Cohen, Beeler):
116 A modification to munching squares which reveals them in frozen states
117 through opening and closing curtains: insert FADR 2,1 before the XOR. Try
118 data switches =
119
120 .EX
121     4000,,4    1000,,2002    2000,,4    0,,1002
122 .EE
123 .RS 8
124 (Notation: <left half>,,<right half>)
125
126 Also try the FADR after the XOR, switches = 1001,,1. 
127 .SH COPYRIGHT
128 Copyright \(co 1997 by Tim Showalter.  Permission to use, copy, modify, 
129 distribute, and sell this software and its documentation for any purpose is 
130 hereby granted without fee, provided that the above copyright notice appear 
131 in all copies and that both that copyright notice and this permission notice
132 appear in supporting documentation.  No representations are made about the 
133 suitability of this software for any purpose.  It is provided "as is" without
134 express or implied warranty.
135 .SH AUTHOR
136 Tim Showalter <tjs@andrew.cmu.edu>, 17-Jun-97, based on what's in the
137 Jargon File and stealing stuff from existing xscreensaver modules.