Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi TICTACTOE KI mit BACKTRACKING (Recursion) need HELP (https://www.delphipraxis.net/47472-tictactoe-ki-mit-backtracking-recursion-need-help.html)

TribleXXX 11. Jun 2005 20:11


TICTACTOE KI mit BACKTRACKING (Recursion) need HELP
 
Brauche mal hilfe in sachen backtracking mit TicTacToe.

so ein paar gedankenanstöße wie man das am besten macht habe bisher keinen Plan wie ich das machen soll.

Habe nene Array [0..2,0..2] of Char

TribleXXX 12. Jun 2005 10:56

Re: TICTACTOE KI mit BACKTRACKING (Recursion) need HELP
 
NegaMax:
Input arguments "player" and "board".

1. If the "player" wins on "board" as it is now return 1.
2. If the other "player" wins on "board" as it is now return -1.
3. Set the temporary variable "best" to an arbitrary negative number.
4. For every possible move do 4.1 to 4.4.
4.1. Go recursively to 1. with the "player" set to the opponent player, and "board" changed according to the move to test.
4.2. Set the temporary variable "value" to the negative value of the returned value from the recursion in 4.1.
4.3. If "value" is higher than "best", set "best" to "value".
4.4. Reset "board" and "player" to how it looked before 4.
5. Reset "board" and "player" as in 4.4.
6. If "best" has the same arbitrary negative number as assigned in 3. then return 0.
7. Else return "best".

Look for the function NegaMax in "tgui.cxx" in my source for an C implementation.


habe jetzt hier so nen algorithmus gefunden? kann mir das mal einer erklären?

dizzy 12. Jun 2005 16:05

Re: TICTACTOE KI mit BACKTRACKING (Recursion) need HELP
 
Ist die Forensuche so schlecht!? Hier im Forum suchentictactoe Hier im Forum suchenminimax ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:12 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz