Clone the repo and go to root folder of repo. Then run the following commands.
// Build docker image
docker build . -t <your username>/absurd-agent
// Run the docker image
docker run -p 8000:8000 -d <your username>/absurd-agent
//Now you can send Request to server using Thunder client or Postman or you can run cli.py and enter the port number to play the game.
After running your server, you can either use POSTMAN or Thunder Client to send GET
and POST
request to localhost:8000
. Or you can python cli using below commands:
// After running your docker container
python ./cli.py
You will be asked for port number. Enter 8000
as setup in above section.
Now you can use our command line interface.
Below Games are currently available and You can get list of Games by Sending a request to GET /
.
- Wordle : A game where you have to guess a 5 letter word in 6 chances. You will have to send a word and you will get an array of numbers. In which 0 -> letter not present, 1 -> letter present but at another position, 2 -> letter present at correct position
- Hangman : A game where you have to guess a Word in 7 wrong chances. The length of the word is provided. You have to send a letter, in response you will get an array of indices where the letter is present or -1 if the letter is not present in the word
- Hanguced : This is a reduced difficulty version of Hangman. When game starts, you will get length of mystery word and an array of letters. The word will be made out of letters from that array.
- Wordman : In this game you have to guess a 5 letter word with 7 wrong chances. You have to guess letter and its position. In response you will get 0 -> letter not present, 1 -> letter present but at another position, 2 -> letter present at provided position.
- Duordle : This is two wordle games playing together. You have to guess two words in 9 chances.
Below are steps to Play any above game:
- Send a request to
GET /
. You will get a list of games. It will initialize a session for you. - Send a request to
POST /
with your game for e.g.{"game" : "wordle"}
. Then you will get a success message if the game is wordle, wordman or Duordle. You will get number of letters if selected game is hangman. You will get number of letters and options if game is hanguced. - Now you have to send your response at
POST /
. - Details of request and response for each game is given below.
- When the game ends session will be destroyed.
When you start your game with GET /
, you can set your dictionary by making a request at POST /dictionary
. By default dictionary contains list of english words. Request will look like below, here set
parameter is 1, which means dictionary will be replaced by received words, if set
parameter is not sent in request then list of words in request will be appended to original dictionary.
{
"words":["this","is","a","list","of","words"],
"set":1 //optional
}
Wordle is a beloved word-guessing game that offers a unique challenge:
- Upon starting, you'll receive a success message that you're in the Wordle game.
- Your objective is to deduce a 5-letter mystery word within 6 attempts.
- Participate by submitting words to
POST /
(e.g.,{"word": "anime"}
). Ensure your word consists of exactly 5 letters. - After each attempt, you'll receive a feedback array of numbers indicating the accuracy of your guesses, like
[1, 0, 0, 0, 2]
.0
: Letter not present.1
: Letter present but in the wrong position.2
: Letter present and in the correct position.
- In case you exhaust all 6 attempts, you'll be informed of a "Game Lost," revealing the correct word and your attempt history.
- Successfully guessing the word within 6 attempts will earn you a "Game Win" message, along with your correct guess and attempt history.
Get ready for engaging word challenges and have a blast playing our assortment of word games!
-
Get ready for the classic challenge of Hangman!
-
At the start, you'll receive the length of the mystery word.
-
Send your guesses to
POST /
using the format{"letter": "a"}
where "a" is your chosen letter. -
If the guessed letter doesn't exist in the word, you'll receive a response of
-1
. -
If the guessed letter exists in the word, you'll receive an array of indices indicating where the letter is found.
-
Make your guesses within 7 wrong attempts to win the game.
-
If you don't guess the word within 7 wrong attempts, you'll receive a "Game Lost" message along with the correct word and your attempt history.
-
Successfully guessing the word before 7 wrong attempts will earn you a "Game Win" message, along with your correct guess and attempt history.
Enjoy the thrill of the Hangman challenge and have a blast playing our assortment of word games!
Engage in a novel twist on the classic Hangman game with Hanguced:
-
Enjoy Hangman with an exciting twist—choose letters from a predefined set!
-
Upon initiation, the game will present you with the following details:
- The number of blanks to fill, similar to the word length in traditional Hangman.
- An array of letters to select from.
Example starting message:
{ "blanks": 7, "letters": ["p", "c", "i", "l", "a", "w", "h", "f", "y", "e", "k", "b", "x", "d", "s"] }
-
Utilize the provided letters to guess the word, adhering to the familiar Hangman rules.
-
Make your guesses by sending them to the POST / endpoint, using the format {"letter": "a"}, where "a" is your selected letter.
-
Receive responses that indicate the correctness of your guesses.
-
Your goal remains the same: uncover the word within the designated number of attempts. Note: All other rules and instructions mirror the traditional Hangman game.
Embrace the challenge of Hanguced's unique letter-selection feature and enjoy a fresh take on the classic Hangman experience!
In this game you have to guess a 5 letter word with 7 wrong chances. You have to guess letter and its position. In response you will get 0 -> letter not present, 1 -> letter present but at another position, 2 -> letter present at provided position.
- Send a request to
GET /
. - Send a request to
POST /
with request body{"game":"wordman"}
. - You will get a success message.
- Now you have to send request to
POST /
with body as in this,{"letter":"e","position":3}
, now there are three possible responses:- 0 : letter is not present in the mystery word
- 1 : letter is present in mystery word but at another position
- 2 : letter is present at position given in body
- If you get 6 zeroes before guessing the mystery word then player loses. And you will get response as in below e.g.:
{ "status": "Game Lost","correctWord": "pease", "attemptHistory": [ { "letter": "e", "position": 4, "data": { "response": 2 } } ] // attemptHistory will contain an array like this }
- If you guess the correct word correctly, then you will get a response like below:
{ "status": "Game Won", "correctWord": "narre", "attemptHistory": [ { "letter": "a", "position": 0, "data": { "response": 1 } } ] // attemptHistory will contain an array like this }
You will only win the game when you will correctly guess both the letter and position.
This game is similar to wordle, but you have to guess 2 words of length five simultaneously in 9 attempts. If you correctly guessed both the word in 9 attempts player will win the game or else player will lose.
- Send a request to
GET /
. - Send a request to
POST /
with request body{"game":"duordle"}
. - You will get a success message.
- Now send your words to
POST /
with body as in e.g.{"word":"slate"}
. Now you will get response object like below, wheregameOne
represents response for mystery word one andgameTwo
represents response for mystery word two. 0,1,2 means same as in wordle:{ "gameOne": [ 0, 0, 1, 0, 0 ], "gameTwo": [ 1, 0, 0, 0, 0 ] }
- If you guess one correct for e.g. like of
gameTwo
it will send "Completed" in gameTwo of response object. - If you are unable to guess both the words then you will lose and will get a response like below:
{ "status": "Game Lost", "correctWordOne": "forma", "correctWordtwo": "omnis", "attemptHistory": [ { "attempt": "slate", "data": { "response1": [0,0,1,0,0], "response2": [1,0,0,0,0] } } ] // attemptHistory like this }
- If you correctly guess both the words in 9 attempts you will get
status:"Game Win"
in response object with above body.