Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tower of Hanoi question
Message
From
18/06/2009 16:00:30
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01406816
Message ID:
01407002
Views:
67
>Hi All, yes I know it's an old topic :-) but , I felt like having a bit of fun ! , I've just written a GUI TOH using C# and have it working fine - including a "Solve" button which shows an animated solution starting the game from scratch, what I would like to provide , is , if the player ( me ) gets stuck part of the way through a game and needs to see the solution, is , to solve it from the current state of play - my maths fail me here :-( - anyone know how to do this ?

One non-mathematical approach:

- Before the game even starts, you know the "optimal" solution
- As the player makes moves, check them against the optimal solution
- If the player's moves are optimal, well and good
- If they are not optimal (i.e. "mistakes"), start tracking the moves
- If the player gives up, you can "undo" their mistakes one at a time, going back to where they made the first mistake, then you solve it optimally from there
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform