What you must do :
When you locate a word from the list, you must output its beginning position and its ending position < column>< row>:< column>< row>.
As an example, if you search for jar in this array:
A B j a r
A z D e F
z f D q W
P T w V Q
Z O q H I
The word jar is located at : C1:E1
The output should be : game< 1-3> word:< word found>
location:< beginning-end>
Your program must download the list of words at each execution, as it may change over time.
The list of words to search for is accessible thru:https:// wordfinder-001.appspot.com/word.txt (List of words extracted from: http://wordfinder.yourdictionary.com/letter-words/3)
To access a letter at a specific location: https:// wordfinder-001.appspot.com/wordfinder? game=< 1to3>&pos=< column>< row>
Column: a-e
Row: 1-5
As an example : https://wordfinder-001.appspot.com/wordfinder? game=1&pos=b5 will return the letter E, which is the letter in the 2nd column, the 5th row.
The main class must be named: project1.java and be in the package csc312.
The system you are accessing to extract the letter, may produce status code SC_INTERNAL_SERVER_ERROR=500 or SC_FORBIDDEN=403 at random interval, if this happen, you must retry accessing the resource up to 5 times.
To test your error handling for SC_INTERNAL_SERVER_ERROR and SC_FORBIDDEN, there are specific pos that will generate it all the time:
If you use pos=Z99, the status code will be SC_INTERNAL_SERVER_ERROR.
If you use pos=Z88, the status code will be SC_FORBIDDEN. Submission: one submission per team. Upload a zipped file or your project directory.
A word finder server, similar to what you had to interact with for Project #1, but this time, you will be handling the request with additional functionality.
1-Starting a contest: an user must start a contest, before requesting a letter, with a url such as : http://localhost:8080/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 used a contest id which is currently in used.
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.
2-Accessing a letter: to access a letter at a specific location: http:// localhost:8080//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 responded with the status code: response.SC_BAD_REQUEST.
3-Submitting a solution: to submit a solution for a game, you must do it in the contact of a contest, a specific url is used: http://localhost:8080// 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 game 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, you must keep the top score (see #4). The solutions must be:
Game 1: position A1:A3, solution: zap
Game 2: position E3:E5, solution: zig
Game 3: position C2:C4, solution: zag
4-Top Score: the url : https:// localhost:8080/topscore, will return in descending order the list of the 5 fastest time to resolve any game.
Output:
contest id, time in seconds
5-Word list: the url https:// localhost:8080/words, will return this list of words:
zap
zep
zip
zag
zig
6-Unit tests:
you must provide individual unit tests for each items that you must test: