munch(6)

πŸ“¦
version 6.15 Β· 2 versions
, in alpine 3.24, arch rolling, nixpkgs unstable

πŸ“ munch(6) β€” the XScreenSaver manual, but make it cute πŸ“

okay bestie so you're reading the XScreenSaver manual, section 6 (6 is the games/demos girlies, iykyk), and this page is all about munch. it's giving retro-iconic and honestly it ate. let's get into it πŸ’…


✨ NAME ✨

munch β€” munching squares. that's it. that's the whole vibe. πŸŸͺ🟩


✨ SYNOPSIS ✨

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

copy it exactly, queen, don't be retyping flags from memory 😭


✨ DESCRIPTION ✨

so munch runs the munching squares hack, and it full-on picks the square size, the position, and the gravity randomly every time. main character energy fr fr. it also shows off a creatively broken misimplementation of the classic algorithm β€” like a chaos remix, and we love her for it 🫢

here's the actual lore: the munching squares hack is just drawing Y = X XOR T for a range of X and T, over and over, until all the possible combinations of X and T have come up. that's the whole bit. reportedly discovered by Jackson Wright in 1962, and it took 5 instructions of PDP-6 code. five. πŸ”₯ not me being obsessed with a five-instruction flex.


✨ OPTIONS ✨

munch accepts the following options:

  • --window β€” draw on a newly-created window. this one is the default, so it's already happening, no notes πŸ’–
  • --root β€” draw on the root window instead. go big, put it on your whole desktop background, slay 🌈
  • --window-id number β€” draw on the window you point at with that specific id number. targeted behaviour, we respect it 🎯
  • --mono β€” if you're on a color display, just pretend we're on a monochrome display. delusion, but make it intentional πŸ’€
  • --install β€” install a private colormap for the window. fancy palette, private club ✨
  • --visual visual β€” specify which visual to use. legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual. do not invent a third kind, bestie πŸ™ˆ
  • --delay usecs β€” the delay between steps of the animation, in microseconds. default: 2500. that's the tempo, the bpm, the heartbeat πŸŽ€
  • --xor β€” use the XOR drawing function. this is the default, iconique as always πŸ‘‘
  • --no-xor β€” don't use the XOR drawing function. contrarian queen behaviour πŸ’…
  • --clear number β€” number of squares to misdraw before clearing the display. default: 65
  • --simul number β€” number of squares to misdraw simultaneously. default: 5. multitasking icon πŸ”₯
  • --classic β€” draw classic munching squares only. pure, unbothered, original recipe 🌸
  • --mismunch β€” draw "mismunch" only. the broken remix, only ❀️‍πŸ”₯
  • --random β€” do one or the other. chaos decides, we just press play 🎲
  • --fps β€” display the current frame rate and CPU load. numbers on screen, we love stats πŸ¦‹
tiny heads-up: --no-xor is how it's written in the options list, but the synopsis spells it --noxor. both live here, both are valid, don't come for me πŸ’œ

✨ ENVIRONMENT ✨

  • DISPLAY β€” to get the default host and display number. this is how it knows where to draw, periodt 🌟
  • XENVIRONMENT β€” to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property. fancy override energy ✨
  • XSCREENSAVER_WINDOW β€” the window ID to use with --root. it's giving teamwork 🫢

✨ HISTORY ✨

okay history lesson, grab a strawberry πŸ“

HAKMEM: MIT AI Memo 239, Feb. 29, 1972. Beeler, M., Gosper, R.W., and Schroeppel, R.

"Unless otherwise stated, all computer programs are in PDP-6/10 assembly language."

not the all-caps quote, they knew they were being iconic ❀️


πŸ’œ ITEM 146: MUNCHING SQUARES πŸ’œ

another simple display program. it is thought that this was discovered by Jackson Wright on the RLE PDP-1 circa 1962. ancient lore, still serving:

DATAI 2
ADDB 1,2
ROTC 2,-22
XOR 1,2
JRST .-4

2=X, 3=Y. try things like 1001002 in data switches. this also does interesting things with operations other than XOR, and rotations other than -22. (try IOR; AND; TSC; FADR; FDV(!); ROT -14, -9, -20, ...) go wild, experiment, it's your sandbox 🧚


πŸ’œ ITEM 147 (Schroeppel) πŸ’œ

munching squares is just views of the graph Y = X XOR T for consecutive values of T = time. that's the tea β˜•


πŸ’œ ITEM 148 (Cohen, Beeler) πŸ’œ

a modification to munching squares which reveals them in frozen states through opening and closing curtains: insert FADR 2,1 before the XOR.

try data switches =

4000,,4    1000,,2002    2000,,4    0,,1002

(notation: <left half>,,<right half>)

also try the FADR after the XOR, switches = 1001,,1. two variations, both valid, pick your fighter πŸ’…


✨ SEE ALSO ✨

X(1), xscreensaver(1), https://www.inwap.com/pdp10/hbaker/hakmem/hakmem.html

go read the friends, they're literally right there πŸ¦‹


Copyright Β© 1997 Tim Show alter. Copyright Β© 2004 Steven Hazel. Copyright Β© 1992-2008 Jamie Zawinski.

permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. no representations are made about the suitability of this software for any purpose. it is provided "as is" without express or implied warranty.

no warranty bestie, it's "as is", handle with care 😭🫢

and that's the page!! shoutout to the X Version 11 girlies, this is version 6.15 dated 30-Mar-2026, and yes we're still on munch(6). byeee πŸ‘‘πŸ’–

πŸ“¦ where this page comes from