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

NAME

6       munch - munching squares
7

SYNOPSIS

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

ENVIRONMENT

73       DISPLAY to get the default host and display number.
74
75       XENVIRONMENT
76               to  get  the  name of a resource file that overrides the global
77               resources stored in the RESOURCE_MANAGER property.
78
79       XSCREENSAVER_WINDOW
80               The window ID to use with --root.
81

HISTORY

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

SEE ALSO

118       X(1), xscreensaver(1),
119       https://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html
120
122       Copyright © 1997 Tim Show alter.
123       Copyright © 2004 Steven Hazel.
124       Copyright © 1992-2008 Jamie Zawinski.
125
126       Permission to use, copy, modify, distribute, and sell this software and
127       its  documentation  for any purpose is hereby granted without fee, pro‐
128       vided that the above copyright notice appear in  all  copies  and  that
129       both  that  copyright  notice and this permission notice appear in sup‐
130       porting documentation.  No representations are made about the suitabil‐
131       ity  of  this software for any purpose.  It is provided "as is" without
132       express or implied warranty.
133
134
135
136X Version 11               6.08-1.fc38 (17-Oct-2023)                 munch(6x)
Impressum