Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!sdd.hp.com!spool2.mu.edu!samsung!munnari.oz.au!metro!otc!gregm From: gregm@otc.otca.oz.au (Greg McFarlane) Newsgroups: alt.sources Subject: VI SOLVES MAZE (and lies about it) Message-ID: <2158@otc.otca.oz> Date: 11 Jan 91 01:56:21 GMT Sender: news@otc.otca.oz Reply-To: gregm@otc.otca.oz.au (Greg McFarlane) Organization: OTC Development Unit, Australia Lines: 68 A real working model. See it walk the maze in front of your very own eyes. To prove that you can do anything in vi, I wrote a couple of macros that allows vi to solve mazes. It will solve any maze produced by maze.c that was posted to the net last month. (Maze.c is also included below.) Just follow this recipe and SEE FOR YOURSELF. 1. save this article and strip off all lines except those between the "cut here for vi macros" markers 2. run uudecode on the file to produce "maze.vi.macros" 3. if you haven't already done so, compile maze.c (cc -o maze maze.c) 4. run maze > maze.out and input a small number (for example 10 if you are on a fast machine, 3-5 if slow) which is the size of the maze to produce 5. edit the maze (vi maze.out) 6. include the macros with the vi command: :so maze.vi.macros 7. type the letter "g" (for "go") and watch vi solve the maze 8. when vi solves the maze, you will see why it lies Tested on a sparc, a sun and a pyramid (although maze.c will not compile on the pyramid). Any donations should be in unmarked small denomination bills :^)=. uuencoded maze.vi.macros: (note that the second last line (above "end") consists of a single space) ----------------- cut here for vi macros ---------------------- begin 664 maze.vi.macros M,D=1 M;&UA1UE*>DIE2D1*2U P4V!A"FUA<"!,(%%!;6%'3D(P33!%0&T-=UA@84!M M1U0D0B12,$TP14!M#69:8E-B6$=62C!(8&% 6P*;6%P($$@70@"FUA<"!6(&%R&PIM87 @2B B8W *;6%P($@@(G)Y) IM87 @ M1B B;GEL"FUA<"!9(&]S02 @:R!%6B!S05\@;6T@0EH@