Message
| Now I worked out what is the longest path in New Darkhaven. A bit of extra code worked it out:
max_length = 0
for from_room, dests in pairs (paths) do
for to_room, how in pairs (dests) do
if table.getn (how) > max_length then
max_length = table.getn (how)
long_from = from_room
long_to = to_room
end -- if longer
end -- of each to room
end -- each from room
print ("Longest path (", table.getn (paths [long_from] [long_to]), "nodes) was from",
long_from, "to", long_to)
print ("From ", rooms [long_from].name, "to", rooms [long_to].name)
print ("Path = ", table.concat (paths [long_from] [long_to], ","))
Starting ...
rooms = 257
Made 58333 particles to do that
Time taken = 2 seconds
Longest path ( 28 nodes) was from 21294 to 21324
From Beneath the Elm Tree to Atop the Battlements
Path = w,w,w,n,n,e,e,e,e,e,e,n,n,e,e,e,e,n,n,n,n,n,n,n,n,u,s,s
Then for a bit of fun I ran Ked's algorithm over all the rooms in SMAUG FUSS (1547 of them anyway), and got these results:
Starting ...
rooms = 1547
Made 1442853 particles to do that
Time taken = 383 seconds
Longest path ( 87 nodes) was from 3469 to 1577
From The Gilded Hallway to The treasure room
Path = n, n, n, n, n, w, n, w, s, w, u, w, s, e, e, s, e, e, e, w, u, s, w, n, n, e, e, n, u, n, n, n, n, n, n, n, w, n, n, e, e, e, e, e, e, e, e, e, e, e, e, n, n, n, n, n, n, e, se, sw, s, se, e, e, s, s, s, e, n, d, w, s, w, w, w, n, w, w, sw, s, sw, n, w, w, n, n, w
During execution of this my copy of lua50.exe peaked at over 1 Gb of virtual memory usage, so it was pretty intensive.
So, the longest walk you can take in SMAUG is from room 3469 (chapel.are) to room 1577 (srefuge.are).
I converted that to a speedwalk string by replacing "," by ")(" and then adding a "(" to the start and an ")" to the end. Then running RemoveBacktracks over the resulting string gives me this:
5n w n w s w u w s 2e s 2e u s w 2n 2e n u 7n w 2n 12e 6n e (se) (sw) s (se) 2e 3s e n d w s 3w n 2w (sw) s (sw) n 2w 2n w
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|