Date: 06 Jun 1999 11:41:29 -0500 From: Joel Ray Holveck <joelh@gnu.org> To: Peter Jeremy <jeremyp@gsmx07.alcatel.com.au> Cc: hackers@FreeBSD.ORG Subject: Word processor distractions (was Re: Kernel config script:) Message-ID: <863e05cmdi.fsf@detlev.UUCP> In-Reply-To: Peter Jeremy's message of "Fri, 4 Jun 1999 08:37:34 %2B1000" References: <99Jun4.082139est.40325@border.alcanet.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
> I've seen references to people writing Towers of Hanoi in troff, but > I don't have a pointer to the actual code. Can't help you there, but here's something for you: /hanoi{/x{{exit}}def /e{exch}def /d{dup}def /l{loop}def /n exch def /m 2 n 1 sub exp cvi def[m{d 0 eq x if d[e d 0{1 add e 2 div cvi d 0 eq x if e}l pop d 1 sub 2 e exp cvi 2 index e sub 1 add e d n e sub 3 1 roll 1 and 0 eq{0 e sub}if 3 mod 3 add 3 mod]e d m ge{{d 1 and 0 eq x if 2 div cvi}l 2 div cvi}{2 mul 1 add{d m and 0 ne x if 2 mul}l}ifelse}l pop]}def It's an iterative implementation of Towers of Hanoi in PostScript. I'm quite proud of it, in a twisted sort of way. If you ever come across that troff code, let me know! > Of course, it doesn't come close to emacs' capabilities - check out > 'info emacs Amusements' :-). When running under X, you can play with > the fonts and colours as well. There's more than just the docs show. I do suggest looking around in the Lisp directories now and then; there's lots of stuff that's not documented, games and otherwise. Have you ever tried M-x tetris? It's in there, at least as of GNU Emacs 20.3. I suppose that if we consider Towers of Hanoi to be a useful distraction, then we'll also add in Life (M-x life) as well; I suspect that Life distracted Bill Gosper more than Towers of Hanoi has distracted any single hacker. If you want a bit more modern of a distraction, a neural net bot that uses landmarks to find the center of a box is in the 20.3 distribution too; try M-x landmark. There's also some tools to help you analyze games. For instance, a mode to help you document decision trees in chess is included; see /usr/local/share/emacs/20.3/lisp/play/gametree.el. There's also a mode for helping you with monoalphabetic substitution ciphers that the games mags love so much has been. It has frequency analysis for characters and digrams, can bring up adjacency lists, has the ability to push and pop mappings, and of course keeps your plaintext up-to-date as you change the mappings. Take a look in decipher.el. If you're tired of playing with fonts, try something a bit more substantial: get a handwritten printout of the buffer with M-x handwrite. Be sure to enable PostScript support on your printer first if you want a hard copy. We have the more advanced /usr/games/morse, but Emacs does include M-x morse-region and M-x unmorse-region for your continued enjoyment. It's not autoloaded, so do M-x load-library RET morse RET or include (require 'morse) in your .emacs file first. I've started another version with prosigns, ISO-8859-1 and KOI8R support, and the ability to use /dev/speaker, but it's not done yet and may never be. For those who are into frustration, the peg solitaire game (jump pegs, try to leave just one) is in M-x solitaire. If you're interested in that game, then you'll probably also want to look at HAKMEM item 75, in which Bill Gosper, Steve Brown, and Malcolm Rayfield briefly analyze the game, and present a winning solution. (Item 76 covers the triangular Hi-Q game.) If you don't have a copy of HAKMEM, email me for one. The Emacs docs discuss Dissociated Press, but don't mention the StuDlYCApSiFIer, which provides studlify-word, -region, and -buffer. You'll need to either M-x load-library RET studly RET first, or add (require 'studly) to your .emacs if you want to use this. Sure to be a winner for LaTeX fans! :-) If you want to fnord overload the NSA's email scanners (Just what do you mean by paranoid?) by randomly including hot words like Waco, Texas cryptographic Delta Force strategic Panama Rule Psix security quiche colonel SDI jihad spy AK-47 Treasury terrorist then try M-x spook. If you prefer to use your own phrase file, then create a /usr/local/share/emacs/20.3/etc/bruce.lines with null-terminated strings (use C-q C-@ to insert a NUL), and run M-x bruce. For instance, if you believe there are CDA scanners that you want to trigger, then you could fill this data file with George Carlin's latest list and let 'er rip. On the other hand, if you're a fan of the CDA, then you may be concerned your children discovering the existance of the sex(6) manpage installed in /usr/local/share/emacs/20.3/etc/sex.6 without your supervision. In this case, you'll want to add (require 'meese) to your site-init.el file. Finally, what distraction suite would be complete without the traditional move-snake-eat-points game? If you're into that sort of thing, try M-x snake sometime. Well, I hope I haven't brought FreeBSD development to its knees now by introducing all these games. I don't think it's coincidence that everybody who has ported Quake to FreeBSD has been too distracted to make a port of it. > Emacs has also had the ability to embed viruses in documents for far > longer than M$-Word has been around - but the defaults are somewhat > more sensible and there don't seem to be as many virii floating > around. I haven't seen any, have you? The fact that it actually *shows* you the code before asking for confirmation probably helps, as well as the fact that anybody can see it in the document. Cheers, joelh -- Joel Ray Holveck - joelh@gnu.org Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?863e05cmdi.fsf>