From: "Jon A. Lambert" Date: 2005-08-30T13:50:16+09:00 Subject: Re: Still looking for a Ruby MUD client Sy wrote: > > A MUD would be a horrifically complex and lengthy project, which I > have no interest whatsoever in writing. Nah, here's a complete mud in a mere 15 lines of ruby thats loaded with features. require 'socket';require 'yaml';def q x;$m.find{|o|o.t==:p&&x==o.n};end def a r,t;$m.find_all{|o|t==o.t&&(!r||r==o.l)};end;def g z;a(nil,:p).each{|p| p.p z};end;class O;attr_accessor :i,:n,:l,:e,:s,:t;def initialize n,l=nil,t=:r @n,@l,@i,@t=n,l,$d+=1,t;@e={};end;def p s;@s.puts(s)if @s;end;def y m v=$m.find{|o|@l==o.i};t=v.e.keys;case m;when/^q/;@s.close;@s=nil; File.open('d','w'){|f|YAML::dump $m,f};when/^h/;p "i,l,d,g,c,h,q,,O,R" when/^i/;a(@i,:o).each{|o|p o.n};when/^c.* (.*)/;g "#{@n}:#{$1}" when/^g/;a(@l,:o).each{|q|q.l=@i};when/^d/;a(@i,:o).each{|q|q.l=@l} when/^O (.*)/;$m<