You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hunting at a node consumes 1 stamina, traveling from node to node consumes 1 stamina.
A hunter with 0 stamina cannot hunt, but can rest to recover stamina.
The graph is directed, D&D cannot traverse back and forth between nodes. D&D can either hunt together or split up.
A node can be hunted in multiple times, however a node provides diminishing returns as it is hunted in.
A node starts with 3 boar, and each hunt will reduce the number of boar by 1, when the number of boars in a node reaches 0, no new boar can be hunted there.
D&D can hunt together or split up, either way they have a 100% chance of bagging a boar.
However if they choose to split up, hunting consumes 2 stamina, but this allows D&D to bag 2 boars a turn.
FYI, the hunting map is provided in the source code as an array, you probably want to convert it to a matrix of some sort.
Resting, hunting and moving from node to node consumes 1 turn, note that if D&D are moving separately, they do not each consume one turn.
I leave it up to your imagination how you should implement D&D moving separately, maybe there should be each turn D&D are allowed 1 action each? (Hint hint)
D&D end the hunt at node "K", at which they get to the choppa
Expected Solution
The solution should be object oriented, based on DRY and single responsibility principles.
Expect to implement some kind of search or crawl
Provide comments in code to explain implementation
Outputs
The output should be in the format of an STDOUT (println to the terminal)
The number of boars bagged and the path of the hunt.
The path of the hunt in a single line, i.e. 'A B C D ...'
About
This is the coding test for prospective supahands engineers