1munch(6x)                     XScreenSaver manual                    munch(6x)
2
3
4

NAME

6       munch - munching squares
7

SYNOPSIS

9       munch  [-display  host:display.screen] [-foreground color] [-background
10       color] [-window] [-root] [-mono] [-install]  [-visual  visual]  [-delay
11       usecs]  [-xor]  [-noxor]  [-clear  number]  [-simul number] [-classic |
12       -mismunch | -random] [-fps]
13

DESCRIPTION

15       The munch program performs the munching squares hack.  It picks  square
16       size,  position,  and  gravity randomly.  It also displays a creatively
17       broken misimplementation of the classic algorithm.
18
19       The munching squares hack consists of drawing Y = X XOR T for  a  range
20       of X and T over and over until all the possible combinations of X and T
21       have come up.  It was reportedly discovered by Jackson Wright  in  1962
22       and took 5 instructions of PDP-6 code.
23

OPTIONS

25       munch accepts the following options:
26
27       -window Draw on a newly-created window.  This is the default.
28
29       -root   Draw on the root window.
30
31       -mono   If on a color display, pretend we're on a monochrome display.
32
33       -install
34               Install a private colormap for the window.
35
36       -visual visual
37               Specify  which  visual  to use.  Legal values are the name of a
38               visual class, or the id number (decimal or hex) of  a  specific
39               visual.
40
41       -delay usecs
42               The delay between steps of the animation, in microseconds.  De‐
43               fault: 2500.
44
45       -xor    Use the XOR drawing function.  This is the default.
46
47       -no-xor Don't use the XOR drawing function.
48
49       -clear number
50               Number of squares to misdraw before clearing the display.   De‐
51               fault: 65.
52
53       -simul number
54               Number of squares to misdraw simultaneously.  Default: 5.
55
56       -classic
57               Draw classic munching squares only.
58
59       -mismunch
60               Draw "mismunch" only.
61
62       -random Do one or the other.
63
64       -fps    Display the current frame rate and CPU load.
65

ENVIRONMENT

67       DISPLAY to get the default host and display number.
68
69       XENVIRONMENT
70               to  get  the  name of a resource file that overrides the global
71               resources stored in the RESOURCE_MANAGER property.
72

HISTORY

74       HAKMEM: MIT AI Memo 239, Feb. 29, 1972.  Beeler, M., Gosper, R.W.,  and
75       Schroeppel, R.
76
77       "Unless  otherwise stated, all computer programs are in PDP-6/10 assem‐
78       bly language."
79
80   ITEM 146: MUNCHING SQUARES
81       Another simple display program. It is thought that this was  discovered
82       by Jackson Wright on the RLE PDP-1 circa 1962.
83
84            DATAI 2
85            ADDB 1,2
86            ROTC 2,-22
87            XOR 1,2
88            JRST .-4
89
90       2=X,  3=Y. Try things like 1001002 in data switches. This also does in‐
91       teresting things with operations other than XOR,  and  rotations  other
92       than -22. (Try IOR; AND; TSC; FADR; FDV(!); ROT -14, -9, -20, ...)
93
94   ITEM 147 (Schroeppel):
95       Munching squares is just views of the graph Y = X XOR T for consecutive
96       values of T = time.
97
98   ITEM 148 (Cohen, Beeler):
99       A modification to munching squares which reveals them in frozen  states
100       through  opening  and closing curtains: insert FADR 2,1 before the XOR.
101       Try data switches =
102
103            4000,,4    1000,,2002    2000,,4    0,,1002
104
105       (Notation: <left half>,,<right half>)
106       Also try the FADR after the XOR, switches = 1001,,1.
107

SEE ALSO

109       X(1), xscreensaver(1),
110       https://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html
111
113       Copyright © 1997 Tim Show alter.
114       Copyright © 2004 Steven Hazel.
115       Copyright © 1992-2008 Jamie Zawinski.
116
117       Permission to use, copy, modify, distribute, and sell this software and
118       its  documentation  for any purpose is hereby granted without fee, pro‐
119       vided that the above copyright notice appear in  all  copies  and  that
120       both  that  copyright  notice and this permission notice appear in sup‐
121       porting documentation.  No representations are made about the suitabil‐
122       ity  of  this software for any purpose.  It is provided "as is" without
123       express or implied warranty.
124
125
126
127X Version 11               6.04-1.fc36 (06-Jun-2022)                 munch(6x)
Impressum