The computer determines which position to play by looking ahead two moves. ITERGETNODE
creates a tree from the current position with all possible moves and each node is assigned a value. The node value of the 'leaves' (nodes at which either a player wins or the maximum depth has been reached) is -1
if the human player wins, 1
if the algorithm wins, and 0
if nobody wins. Then, values of all the above nodes are generated by finding either the max or min of all children recursively. The algorithm moves according to the maximum of its children.
lauraschultz/cobol-tic-tac-toe
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
writing a tic-tac-toe game in COBOL because i'm underemployed