-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The three rules of Ruby Q.:
-
Please do not post any solutions or spoiler discussion for this
quiz until 48 hours have elapsed from the time this message was
sent. -
Support Ruby Q. by submitting ideas and responses
as often as you can. -
Enjoy!
Suggestion: A [QUIZ] in the subject of emails about the problem
helps everyone on Ruby T. follow the discussion. Please reply to
the original quiz message, if you can.
RSS Feed: http://rubyquiz.strd6.com/quizzes.rss
Suggestions?: http://rubyquiz.strd6.com/suggestions
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
IRC Teams (#221)
Tashi dele Rubyists,
This week’s quiz was suggested by Martin DeMello
A common feature in IRC-based games is the ability to create and join
teams. The game bot sits in the channel and watches for messages in a
certain format, which it interprets as commands. Write a small gamebot
that accepts the following commands:
create team
join
leave team
show teams
show team
show my team
delete team
reset
Here’s a typical transcript
create team ruby
- created team ruby -
create team python
- created team python -
show teams
teams: ruby, python
show team ruby
team ruby: foo
show my team
bar is in team python
join ruby
baz is now in team ruby
show team ruby
team ruby: foo, baz
Think up some useful extensions, such as the ability to join a user
rather than a team, and restricting some commands like reset to ops.
There are plenty of IRC bot libraries out there, go explore! If one
already does team formation, that’s cheating, though
Have fun!