http://www.jwz.org/xscreensaver/xscreensaver-5.08.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 "29-Aug-2008" "X Version 11"
15 .SH NAME
16 munch - munching squares
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 \fIusecs\fP] [\-xor] [\-noxor] 
22 [\-clear \fInumber\fP] [\-simul \fInumber\fP]
23 [\-classic | \-mismunch | \-random]
24 [\-fps]
25 .SH DESCRIPTION
26 The
27 .I munch
28 program performs the munching squares hack.  It picks square
29 size, position, and gravity randomly.  It also displays a
30 creatively broken misimplementation of the classic algorithm.
31
32 The munching squares hack consists of drawing Y = X XOR T for a range of X
33 and T over and over until all the possible combinations of X and T have
34 come up.  It was reportedly discovered by Jackson Wright in 1962 and took 5
35 instructions of PDP-6 code.
36 .SH OPTIONS
37 .I munch
38 accepts the following options:
39 .TP 8
40 .B \-window
41 Draw on a newly-created window.  This is the default.
42 .TP 8
43 .B \-root
44 Draw on the root window.
45 .TP 8
46 .B \-mono 
47 If on a color display, pretend we're on a monochrome display.
48 .TP 8
49 .B \-install
50 Install a private colormap for the window.
51 .TP 8
52 .B \-visual \fIvisual\fP
53 Specify which visual to use.  Legal values are the name of a visual class,
54 or the id number (decimal or hex) of a specific visual.
55 .TP 8
56 .B \-delay \fIusecs\fP
57 The delay between steps of the animation, in microseconds.  Default: 2500.
58 .TP 8
59 .B \-xor
60 Use the XOR drawing function.  This is the default.
61 .TP 8
62 .B \-no\-xor
63 Don't use the XOR drawing function.
64 .TP 8
65 .B \-clear \fInumber\fP
66 Number of squares to misdraw before clearing the display.  Default: 65.
67 .TP 8
68 .B \-simul \fInumber\fP
69 Number of squares to misdraw simultaneously.  Default: 5.
70 .TP 8
71 .B \-classic
72 Draw classic munching squares only.
73 .TP 8
74 .B \-mismunch
75 Draw "mismunch" only.
76 .TP 8
77 .B \-random
78 Do one or the other.
79 .TP 8
80 .B \-fps
81 Display the current frame rate and CPU load.
82 .SH ENVIRONMENT
83 .PP
84 .TP 8
85 .B DISPLAY
86 to get the default host and display number.
87 .TP 8
88 .B XENVIRONMENT
89 to get the name of a resource file that overrides the global resources
90 stored in the RESOURCE_MANAGER property.
91 .SH SEE ALSO
92 .BR X (1),
93 .BR xscreensaver (1),
94 .RS 0
95 .BR http://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html
96 .SH HISTORY
97 HAKMEM: MIT AI Memo 239, Feb. 29, 1972.
98 .RS 8
99 Beeler, M., Gosper, R.W., and Schroeppel, R.
100
101 "Unless otherwise stated, all computer programs are in PDP-6/10
102 assembly language."
103 .TP 4
104 ITEM 146: MUNCHING SQUARES
105
106 Another simple display program. It is thought that this was discovered by
107 Jackson Wright on the RLE PDP-1 circa 1962.
108
109 .EX
110     DATAI 2
111     ADDB 1,2
112     ROTC 2,-22
113     XOR 1,2
114     JRST .-4
115 .EE
116 .RS 4
117 2=X, 3=Y. Try things like 1001002 in data switches. This also does
118 interesting things with operations other than XOR, and rotations other 
119 than -22. (Try IOR; AND; TSC; FADR; FDV(!); ROT -14, -9, -20, ...)
120 .RE
121 .TP 4
122 ITEM 147 (Schroeppel):
123
124 Munching squares is just views of the graph Y = X XOR T for consecutive
125 values of T = time.
126 .TP 4
127 ITEM 148 (Cohen, Beeler):
128
129 A modification to munching squares which reveals them in frozen states
130 through opening and closing curtains: insert FADR 2,1 before the XOR. Try
131 data switches =
132
133 .EX
134     4000,,4    1000,,2002    2000,,4    0,,1002
135 .EE
136 .RS 4
137 (Notation: <left half>,,<right half>)
138 .RS 0
139 Also try the FADR after the XOR, switches = 1001,,1. 
140 .SH COPYRIGHT
141 Copyright 1997 Tim Showalter.
142 .RS 0
143 Copyright 2004 Steven Hazel.
144 .RS 0
145 Copyright 1992-2008 Jamie Zawinski.
146 .PP
147 Permission to use, copy, modify, distribute, and sell this software
148 and its documentation for any purpose is hereby granted without fee,
149 provided that the above copyright notice appear in all copies and that
150 both that copyright notice and this permission notice appear in
151 supporting documentation.  No representations are made about the
152 suitability of this software for any purpose.  It is provided "as is"
153 without express or implied warranty.