while(ch.IsHungry()) {
if(cost = buy_food(ch, ch->room)) {
ch->Money -= cost;
ch->hunger -= cost/10;
} else {
if(ch.Money > 10000)
move(ch, find_room("blue.dolphin");
else if(ch.Money > 1000)
move(ch, find_room("red.lobster");
else if(ch.Money > 100)
move(ch, find_room("taco.bell");
else
send_to_room(ch, "Can you spare a dime?");
}
}
class Person
def initialize
@last_eaten = nil
@food = ["French Toast", "Pancakes","Cereal","Cheeseburgers","Waffles","Steak"]
end
def eat(food)
if @food.include? food
puts "You eat the #{food}, yummy!"
@food.delete food
@last_eaten = food
else
puts "Aw, too bad. You don't have any #{food}."
end
end
def burp
if @last_eaten == nil
puts "You cover your mouth and burp as politely as possible"
else
puts "You let out a long belch. It tastes like #{@last_eaten}."
end
end
end
Same here. My interest would be further increased if the entry were something that I could reuse in my own mud (because then it wouldn't feel as if I were taking time away from my mud to enter the competition).
That really depends on what the entry is supposed to be used for. If it's something intended to be used out-of-the-box then obviously "fun" is a very important factor, but if it's only intended to serve as a foundation for further enhancements then IMO a stable and elegant design would be far more important.
The 16K MUD competition gave features a weighing of 1.6 and fun a weighing of 1.3, while maintainability and stability were given a weighing of 0.9 and 0.6 respectively. In my opinion that was the wrong way around for a barebones codebase designed as a platform for people to build their own games on.
I would also appreciate it if the weighings were made clear in advance (the 16K MUD competition didn't do this).
That's what I'd prefer as well. For the mudmagic coding contests I ensured that my entries could be compiled and tested as standalone applications, but also came with clear installation instructions for Merc 2.1. I then submitted two copies of my code - one on its own (with the standalone option enabled), and the other preinstalled into a copy of Merc 2.1 (note that I picked Merc 2.1 because (1) I'm familiar with it, and (2) it's the parent of most modern Diku muds and thus reasonably familiar to a wide range of developers, but I think any other well-known codebase would be fine as well).
My second entry also compiled cleanly as both C and C++, so that it could be used in any codebase written in either language, with minimum programming effort.
Obviously I'm highly biased, because it's the approach I already favour, but I think it's one that makes sense considering the wide range of different codebases out there. The more easily a snippet can be ported to different muds, the more likely it is to be used.