stack build --exec blockhead-game-exe
stack test
stack ghci --ghci-options src/Lib.hs
Type :quit
to exit once done.
docker build -t blockhead-game .
docker run -p 8080:8080 -d blockhead-game
curl -v http://localhost:8080/api/field/5
[
".....",
".....",
"БАЛДА",
".....",
"....."
]
curl -v -d '{ "field": [ ".....", ".....", "БАЛДА", ".....", "....." ], "usedWords": [ "БАЛДА" ],"difficulty":"Medium" }' http://localhost:8080/api/move-requests
{
"cell": [
3,
1
],
"letter": "Ф",
"path": [
[
3,
1
],
[
2,
1
],
[
2,
2
],
[
2,
3
],
[
2,
4
]
],
"success": true,
"updatedField": [
".....",
".....",
"БАЛДА",
".Ф...",
"....."
],
"word": "ФАЛДА"
}
For DFS testing. It is possible to find word "ПЛАКАТИСТ" which consists of 9 letters if difficulty
is set to Hard
.
curl -v -d '{"field":[".....","АЛП..","КИСТЬ",".ТКАЖ","....."],"usedWords":["КИСТЬ","","КИСТА","","КИСКА","","ТАКТИК","","ТАКТИКА","","КАЛИТКА","","ЛИСТАЖ","","ПЛИТКА",""],"difficulty":"Hard"}' http://localhost:8080/api/move-requests
There are empty cells but computer cannot find any word.
curl -v -d '{"field":["ЬТЗСР","ЭСАПО","ГОГОТ","ТФАРТ",".ЬРТЫ"],"usedWords":["ГОГОТ","ТОГА","ФАГОТ","АГОГЭ","СОФА","САГА","САПОГ","ТОПАЗ","ЗАПОР","ЗАГАР","СПОРА","СПОРТ","ПОРТЫ","РОПОТ","РОПОТ","ТРОПА","ГАРЬ","ГОСТ","ПАСТЬ","РАФТ"],"difficulty":"Medium"}' http://localhost:8080/api/move-requests
There are empty cells but computer cannot find any word, another example.
curl -v -d '{"field":["ТЬ.ЬН","ОНВДА","ЗАВОЗ","АГАЙЮ","ВАНСО"],"usedWords":["ЗАВОЗ","НАВОЗ","ЗАВОД","ЗАВОДЬ","ВДОВА","ДОЗА","НАВОЙ","НАДОЙ","ЗОНА","АЗОТ","ГАЗОН","ВАЗА","НАВАГА","ВАЗОН","ГАВАНЬ","НАГАН","АГАВА","АВАНС","ЮЗ","СОЮЗ"],"difficulty":"Medium"}' http://localhost:8080/api/move-requests
There are no empty cells.
curl -v -d '{ "field": [ "ТОНЯЯ", "ЕГТЫН", "БАЛДА", "ЕФЛАХ", "ДОПТА" ], "usedWords": [ "БАЛДА", "ФАЛДА", "БАЛЛ", "БАЛТ", "ГАЛЛ", "БЕГА", "БАЛЛАДА", "БАГЕТ", "АЛЛАХ", "НАХАЛ", "АЛТЫН", "ФАГОТ", "БЕТОН", "ПЛАХА", "ПТАХА", "ПЛАТА", "ОПЛАТА", "ДОПЛАТА", "ДЕБЕТ", "ТОНЯ", "ДЫНЯ" ],"difficulty":"Medium" }' http://localhost:8080/api/move-requests