I downloaded a game on android called Walkabout. You walk along a grid, and every block you step on falls out from under you and some blocks MUST BE STEPPED ON (have a star to collect)
This got me started on wondering what's the best way to computationally solve these levels? There is a level where every block that can be stepped on must be stepped on.
I don't know how I'd apply rules to a solution, but I know the levels could be bruteforced.
I would put together an interpreter to parse handmade level codes (something like _ for spot you can step on, * for a star to collect, and # for an obstacle, o for starting position) and then have the program identify any locations from the start that are like this:
Code:
####
##*#
____
because you cannot get out from that location, it would have to be the last star you collect.
The level that got me thinking about this would be layed out like this:
Code:
* * * * * # # # * * * *
* # * * * * * * * * * *
* * * * # * * * # * * #
# * * * # * # * * * * *
* * * * * * * * # * * *
* * * # * * * * # * * *
* # * * * * * o * * * *
* * * # * * * # * * # #
I can't figure this out, but if you go anyway other than right from the start, I don't know how you could get back there to finish up those stars. I've gotten all but one star once.
Anyone want to give input on how someone would make a solver for levels like that (that could even possibly recognize impossible levels like this one)
Code:
# * * * #
O * * * #
# * * * #
Aww heck, I'll make a quick java applet version of it maybe, without graphics most likely, in the next couple of days. I think the easiest thing to do would almost be a maze generator kind of thing.
Code:
# # # # #
# o|* * #
# *|*|* #
# * *|* #
# # # # #