Hi, we were asked to build a 2d complex maze using c++ and sfml.
the game includes:
a king that needs to reach his castle
a warrior that kills orcs and they drop money
a thief that collects the money to open gates

and more characters.
so far no problem.

BUT THAN.... the teacher told us if we make an AUTOSOLVER for the game
we will get 100 in the course without doing the exam.
I've got like 2 days left so I won't make it . but I was wondering
if anyone knows which kind of algorithm suits this problem?

(the levels can be very complex, like 1 coin 1 thief and 150 gates a king and a palace
how will the thief know to open the right gate so the king can pass . also the thief
has to clear the way for the king....)

thanks , just curious :P

Recommended Answers

All 2 Replies

I'd say some dynamic programming, maybe with finding the shortest route or some such.

Everything probably represented as a graph.

so its like taking the thief to gate #1 save the state and turn the
kings algorithm on the new state?
and on the other 149 states?
i dont understand how can this problem be solved in a reasonable time ... :o

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.