Page 1 of 5

Dungeon Master

Posted: Thu Nov 20, 2008 2:28 pm
by Crunch
Hello all,
I have a question about the challenge Dungeon Master. I would like to automate it but I don't know in which language I should write this script and how.
Thanks for your answers
Crunch :wink:

Posted: Thu Nov 20, 2008 5:52 pm
by tails
Hi,

Recently there was a discussion, on the topic "Programming Challenges.", about what language we should use to solve challenges. I think it's also applicable to the dungeon automation.

In the discussion above,
gfoot strongly recommends Python. adum says he also uses it to create challenges. I recommend it too, although I don't know much about it.
the_impaler and I use perl and C(++). But I don't recommend these two to beginners; perl is somewhat obsolete and C(++) is too primitive.
sigi recommends Ruby. m!nus uses PHP. Allosentient prefers C#.

In conclusion, I think you don't have to be very nervous on which language to use.

Posted: Thu Nov 20, 2008 9:34 pm
by snibril
I did it with a bash script.

Posted: Fri Nov 21, 2008 1:47 am
by sigi
snibril wrote:I did it with a bash script.
Wow, I'm certainly interested in seeing that.

Posted: Fri Nov 21, 2008 1:51 am
by sigi
tails wrote:In conclusion, I think you don't have to be very nervous on which language to use.
Making a dungeon "solver" in Java or C(++) would certainly be a lot more work compared to Python, Perl, Ruby or any other scripting language. This challenge calls for scripting in one of its purest forms, so one is well advised to choose a language targeted at that market (most so called "scripting" languages nowadays are simply very-high-level, interpreted, general purpose languages, but let's stick with the scripting term for the moment).

Anyway: don't use a too low level language for tasks like this.

Posted: Fri Nov 21, 2008 12:30 pm
by simon
My one are 300 ugly and slow Bash lines, too...

If i had any clue that I would add so many features and have to reuse it with another goal (less steps) I would have done it in python or at least had started with a cleaner structure... :oops:

Fast and painless reusage is something only good code gives you. And you can write awful code in any language :)

i would post my bot in a "solved -> Cave Master" Thread, but I don't know if this really was the last "dungeon challenge"...

Posted: Fri Nov 21, 2008 4:03 pm
by Allosentient
simon wrote: Fast and painless reusage is something only good code gives you. And you can write awful code in any language :)
That is a big reason why I like to use C#, because it is much easier to write nearly flawless code (some of my older code from 6 months ago looks horrendous though), and the language and debugger is simplified enough so that I can fully control what the program does 100%. If I were going to do a script I would write a simple library first in C# rather than try to do it in python because in the latter case I would not be able to detect every mistake out there.

Posted: Fri Nov 21, 2008 5:32 pm
by tog
I have to admit that I have no idea on how to play this dungeon-game in the first place. I understand that I will have to automate this, and this shouldn't be the problem. But I don't understand the rules of this game (never was into MUDs). To me it seems like clicking randomly on the links, monsters keep coming and I always have to fight them. So is this challenge about following a long sequence of random links? Or does this really make sense?

Posted: Fri Nov 21, 2008 5:39 pm
by simon
Allosentient wrote: That is a big reason why I like to use C#, because it is much easier to write nearly flawless code (some of my older code from 6 months ago looks horrendous though), and the language and debugger is simplified enough so that I can fully control what the program does 100%. If I were going to do a script I would write a simple library first in C# rather than try to do it in python because in the latter case I would not be able to detect every mistake out there.
jeah... C#... i would rather pee myself in bed, you know...

Posted: Fri Nov 21, 2008 5:54 pm
by Allosentient
I tend not to credit any linux users when they argue whether a language is better, unless they can provide reasons... Just trying to avoid the "I'm better than you because I don't believe in capitalism" argument.

I tried linux for years, tried many different versions, and concluded that it doesn't live up to the hype.

Worried about giving money to microsoft? How many windows users here have actually paid for their copy of windows without getting a free copy from someone else?

Worried about paying $300? If you make $30 an hour at your job and you save just ten hours of troubleshooting with linux (and believe me, you will), you've already broken even.

Just a couple of cheap arguments there why I think windows is more practical, save the ideologies for the philosophers.

The only thing I can think of that you can't do with windows that you can do with linux (when dealing with non-server applications) is use the programs that are already there, but the library dependencies, spaghetti C code, and license compatibility rules are horrendous.

They do have some fun games though, gotta admit.

Posted: Fri Nov 21, 2008 7:18 pm
by simon
bla bla... What has this to do with anything? You can write python and C# on both plattforms... And I never said that I want to, or you should change your operating system... Actually I never mentioned my OS... And the last thing I want to have is a discussion about that (do you know how many hours of my life I spended on these discussions? mostly drunk?! it's not funny anymore......).

go back to your highly paid $30/hour developer job and I keep on doing my thing...

Posted: Fri Nov 21, 2008 7:26 pm
by wrtlprnft
Actually I think the ideal language to do this is this javascript :-) Opera and Firefox have User JS/Greasemonkey, you don't have to figure out how to handle authentication and cookies and whatnot, the html is already parsed for you and you don't need extra code to show intermediate results :-)

My script currently is at Dungeon Level 31, I hope this doesn't take much longer :-o
or maybe staying ten levels ahead of the dungeon level isn't such a practical idea

Posted: Fri Nov 21, 2008 7:41 pm
by simon
wrtlprnft wrote:Actually I think the ideal language to do this is this javascript...
First I wanted to write another pee comment, but you brought interesting points. For some rapid solutions (like requested by a few of these challenges) this sounds handy.
no, but the simplest nethack convention works just fine

Posted: Fri Nov 21, 2008 8:15 pm
by Allosentient
simon wrote:bla bla... What has this to do with anything? You can write python and C# on both plattforms... And I never said that I want to, or you should change your operating system... Actually I never mentioned my OS... And the last thing I want to have is a discussion about that (do you know how many hours of my life I spended on these discussions? mostly drunk?! it's not funny anymore......).

go back to your highly paid $30/hour developer job and I keep on doing my thing...
What is so bad about C#, then?

Posted: Fri Nov 21, 2008 10:00 pm
by wrtlprnft
I finally got it… and the depth of this dungeon is waaay over the top… but then again my AI was pretty dumb, too.