-
Starting a contest: A user must start a contest, before requesting a letter, with a url such as :
https://wordfinder-001.appspot.com/newcontest
. The response to newcontest, will return a random number ranging between 1-1000, that will be used for subsequent request as contestid. You must make sure, you do not use a contest id which is currently in use.- For each subsequent request to the server, the contestid must be specified on the url.
- For each contest, a 120 seconds timer countdown must be started. When 0 is reached, subsequent request will be returned the status code
HttpServletResponse.SC_GONE
.
-
Accessing a letter: To access a letter at a specific location:
https://wordfinder-001.appspot.com/wordfinder?contest=<contest id received as response to newcontest>&game=<1 to 3>&pos=<column><row>contest:the contest id receives in newcontest
.- game:
1-3
Column:a-e
Row:1-5
- If the user submits a request, with an invalid contest id, game or pos, you must respond with the status code:
response.SC_BAD_REQUEST
.
- game:
-
Submitting a solution: To submit a solution to the contest, a specific url is used:
https://wordfinder-001.appspot.com/solution?contest=<contest id received as response to newcontest>&game=<1 to 3>&solution=<word>
- contest: The contest id receives in newcontest. game: 1-3 solution: The word which is the solution
- If a submission is valid,
SC_OK
is returned and in the html text, the number of seconds it took to resolve the problem and also, how many letters were requested. - If a submission is invalid for a game, the contest id must be considered invalid, and further request using this contest id should return
response.SC_BAD_REQUEST
. - For a valid submission, keep a list of the 5 fastest (in term of request of letters) contest.
-
Top Score: the url :
https://wordfinder-001.appspot.com/topscore
, will return in descending order the list of the 5 fastest time.- Output: (contest id, time in seconds)
-
Word list: the url
https://wordfinder-001.appspot.com/words
, will return a list of 20, 3 letters words. -
Unit tests: Individual unit tests for each items to test:
- Validation that the word list is correct
- Validation of starting a new contest
- Validation of requesting for a letter (valid and invalid values for each parameter and combination).
- Validation of the timeout process for a contest (see Pausing Execution with Sleep)
- Validation of submitting a solution (valid and invalid submission + management of the contest)
- Validation of the top score
-
Notifications
You must be signed in to change notification settings - Fork 0
A semester long project for Java Tomcat that creates servlets for a WordSearch game. The program searches for a word in a 5*5 grid (each cell contains a letter) from a list of 20, 3 letter words. Once it gets the word, prints the time in mili-seconds it took to find it. Finally, it prints the fastest 5 scores.
nazislam/WordSearch-Servlet-Using-Tomcat
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A semester long project for Java Tomcat that creates servlets for a WordSearch game. The program searches for a word in a 5*5 grid (each cell contains a letter) from a list of 20, 3 letter words. Once it gets the word, prints the time in mili-seconds it took to find it. Finally, it prints the fastest 5 scores.
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published