That is essentially how AI works yes. It's easy to come up with how AI should work, the extremely hard part is actually making it happen.
For those interested in taking a shot at it, this may help:
http://www.doc.ic.ac.uk/~rb1006/projects:marioaiBe sure to check out the demo videos, they're pretty awesome.