Ticket #179 (closed task: fixed)
New gamebot module
| Reported by: | milosh | Owned by: | Maverick |
|---|---|---|---|
| Priority: | normal | Component: | Bots - Other |
| Version: | Latest version from repository | Severity: | minor |
| Keywords: | Cc: |
Description
A project for Charis: While I was creating the scramble module many of my testers made this suggestion, so I'm passing it on to you as an initial project. I'm defining the project very broadly so that there is room to grow; however, I will declare very specific objectives.
The full project: Create a new module for gamebot. The game is commonly referred to as "Words in a Word", but you can find a better name for it if you'd like. The module is a rounds/points based game like scramble or trivia. The bot will select a word of 8 letters or more from a database of words and display it. Users will submit private messages of answers that can be made up of the initial word's letters. When the round ends the player that submitted the most correct answers wins the round and gains a point. The first player to win x number of rounds wins the game.
Example of a Round:
The bot displays the word 'revitalizes'
I private message the bot with 'relative', 'lives' and 'vital'
Charis private messages the bot with 'relive' and 'zeal'
The round ends... I gain a point because I submitted more correct words.
This is a fairly broad initial project for you, so I'm going to split it up into more manageable chunks as well as offer my assistance when you need it. I strongly advise doing study and research within TWCore ESPECIALLY within modules similar to this one.
Tasks(in order):
1.) Create a public boolean method, "containsLetters(String, String)" , with two String parameters. The method should return true if all of the letters in the second string can be found within the first one. Example: containsLetters("revitalizes","vital") would return true. Otherwise it should return false. This is some simple String manipulation. I wrote this method within 8 lines.
2.) Create a public boolean method, "isWord(String)" , with one String parameter. The method should return true if the String can be found within an SQL (dictionary) database. If the String is not found it should return false.
3.) Write a list of commands the bot will use(Hint: See scramble or trivia). Create a
corresponding method for the execution of a command. Don't worry about writing all of the methods yet, just leave them blank. This is for planning purposes. (Example: !start... public void doStartCmd(){}) Declare a public String array for your help message with all of the bots commands listed.
4.)write the method for the !help command (e.g. public void doHelp(String){}). This method should have one String parameter(the name of the person using the command). Make the bot privately spam your public help message to the name given by the parameter.
5.) I will assign more tasks when you get this far... good luck! :-)
