1 XScreenSaver(1) XScreenSaver(1) NNAAMMEE munch - munching squares screen hack SSYYNNOOPPSSIISS ddeeccoo [-display _h_o_s_t_:_d_i_s_p_l_a_y_._s_c_r_e_e_n] [-foreground _c_o_l_o_r] [-background _c_o_l_o_r] [-window] [-root] [-mono] [-install] [-visual _v_i_s_u_a_l] [-delay _s_e_c_o_n_d_s] [-xor] [-noxor] [-shift] [-noshift] [-logminwidth _m_i_n_i_m_u_m _w_i_d_t_h] DDEESSCCRRIIPPTTIIOONN The _m_u_n_c_h program preforms the munching squares hack until killed. It picks square size, position, and gravity ran- domly; configurable options are listed below. The munching squares hack cosists of drawing Y = X XOR T for a range of X and T over and over until all the possi- ble combinations of X and T have come up. It was report- edly discovered by Jackson Wright in 1962 and took 5 instructions of PDP-6 code. OOPPTTIIOONNSS _m_u_n_c_h accepts the following options: --wwiinnddooww Draw on a newly-created window. This is the default. --rroooott Draw on the root window. --mmoonnoo If on a color display, pretend we're on a monochrome display. --iinnssttaallll Install a private colormap for the window. --vviissuuaall _v_i_s_u_a_l 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. --ddeellaayy _s_e_c_o_n_d_s How long to wait before starting over. Default 5 seconds. --xxoorr Use the XOR drawing function. (Default.) --nnoo--xxoorr Don't use the XOR drawing function. --sshhiifftt Start drawing the square at weird starting points. (Default.) --nnoo--sshhiifftt Don't shift and start drawing the square at weird starting points. X Version 11 17-Jun-97 1 XScreenSaver(1) XScreenSaver(1) --llooggmmiinnwwiiddtthh _m_i_n_i_m_u_m_-_w_i_d_t_h The logarithm (base 2) of the minimum with of a square (must be a power of 2, or some parts of the square aren't.) EENNVVIIRROONNMMEENNTT DDIISSPPLLAAYY to get the default host and display number. XXEENNVVIIRROONNMMEENNTT to get the name of a resource file that overrides the global resources stored in the RESOURCE_MAN- AGER property. SSEEEE AALLSSOO XX(1), xxssccrreeeennssaavveerr(1), hhttttpp::////wwwwww..iinnwwaapp..ccoomm//ppddpp1100//hhbbaakkeerr//hhaakkmmeemm//hhaakkmmeemm..hhttmmll,, hhttttpp::////wwwwww..ccoommeeddiiaa..ccoomm//HHoott//jjaarrggoonn__33..00//JJAARRGGOONN__MM//MMUUNNCCHH-- SSQQRR..HHTTMMLL HHIISSTTOORRYY Quoted from HAKMEM, for historical interest. As that doc- ument says, "Unless otherwise stated, all computer pro- grams are in PDP-6/10 assembly language." 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. 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, ...) ITEM 147 (Schroeppel): Munching squares is just views of the graph Y = X XOR T for consecutive values of T = time. 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: ,,) X Version 11 17-Jun-97 2 XScreenSaver(1) XScreenSaver(1) Also try the FADR after the XOR, switches = 1001,,1. CCOOPPYYRRIIGGHHTT Copyright (C) 1997 by Tim Showalter. 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. AAUUTTHHOORR Tim Showalter , 17-Jun-97, based on what's in the Jargon File and stealing stuff from existing xscreensaver modules. X Version 11 17-Jun-97 3