def convert(str)
colors = {:blue => "\e
def convert(str)
colors = {:blue => "\e[1;34m",
:green => "\e[1;32m",
:white => "\e[1:30m"}
codes = {'[water]' => :blue,
'[rare]' => :green,
'[/]' => :white,}
codes.each {|k,v| str.gsub!(k,colors[v])}
puts str
end
convert "You pick up a [water]glass of water[/]. It has [rare]a silver spoon[/] in it."
#OUTPUT
# You pick up a [1;34mglass of water[1:30m. It has [1;32ma silver spoon[1:30m in it.
[/code]
I'm wondering how the MUD designer community feels at large, because I've recently noticed that games with a whole lot of bright colors tend to attract players– do people generally prefer lots and lots of colors (and why?) or do you like designs that have color only placed to emphasize certain things (room names, subjective combat damage verbs, etc.)?