Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
DotBot, CommonCrawl, Yandex

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Recursion Anyone ever use one?
Forum Rules | Mark all | Recent Posts

Recursion Anyone ever use one?
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Aug 20, 2013, 5:55 pm
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

Still learning here. I am wondering if anyone has ever used or saw a useful application for a recursion with muds? Or maybe smaug has recursions and i have not noticed it?
       
Post is unread #2 Aug 20, 2013, 6:27 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

well care to give more detail into what you are looking for on it or mean? :) What I just got through looking at gave all kinds of recursion info and there are lots of different parts that are found in smaug...
       
Post is unread #3 Aug 21, 2013, 3:46 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

There's a reasonably good chance that the algorithm your MUD uses to let NPC's find things, or to let you track NPC's is recursive. Search algorithms are often implemented this way.

room find_something( start_room, target ) {
    if( target.location == here )
        return here;
    foreach exit e, in this room {
        if( possible = find_something( e.room, target ) ) {
            return possible;
        }
    }
    return NULL;
}


Psuedocode, of course, but you get the idea.
       
Post is unread #4 Aug 21, 2013, 7:53 am
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

Thanks just curious because they say recursive code can be a memory hog.
       
Post is unread #5 Aug 21, 2013, 9:26 am
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

They can, if you're not breaking out of the recursion as soon as you find what you're looking for. But, they're usually the easiest way to gather information within a specified format (file, room, vnums, players, etc).
       
Post is unread #6 Aug 21, 2013, 6:34 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

ah see I thought that was the main things he was asking, but wasnt sure. lots of those around lol
       
Pages:<< prev 1 next >>