Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tower of Hanoi question
Message
De
18/06/2009 16:00:30
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01406816
Message ID:
01407002
Vues:
68
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform