On Tue, 23 Oct 2001, Henrik Stuart wrote: > After a long day of classical algebra the wisest thing you can do > is sit down and do your homework... therefore I coded instead. :) > Anyway, joke aside... I've written this small thing that will > output your zones to the dot graph-language format (which is > compiled by the dot tool at www.graphviz.org, which is a truly > awesome tool). Now, some of you might argue that it doesn't look > much like a traditional map, and that it doesn't, but still it > gives a nice overview of the zone. Cool! Must go play... > (And I know a few of the lines in the code are over 80 chars wide, > and if you're annoyed by that, don't say so already). They're just whiners that don't know how to make their text terminals 132 characters wide. ;) > fprintf(fp, "node [fontsize=\"8\"];"); > fprintf(fp, "edge [fontsize=\"8\"];"); fputs("...", fp); You're not actually using a format (%s, %p, %d) there. Minor quibble. > > for (i = 0; i < top_of_world; i++) { > if ((world[i].number / 100) != vnum) > continue; if (world[i].zone != zone) continue; You already have the real zone from above and each room has what zone it's in. > if (world[to].zone != vnum) > outside = 0; Now that's a strange comparison. I'd have thought: if (world[to].zone != zone) continue; > Feel free to mail me with suggestions. And no, you cannot reorder > the graphics to be more map-like using the dot-tool. It uses a > quite cool technique for creating equally weighted graphs (or so it > claims), so it's not meant for actual maps, but it's nice for > graphs and a map is kind of a graph so I chose to use that instead > of writing the graphics program as well. :o) Hm...wonder how badly it'll choke on the entire world being fed to it... I'll know as soon as my compile finishes. :) -- George Greer greerga@circlemud.org -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/06/01 PST