Skip to content

lauraschultz/cobol-tic-tac-toe

Repository files navigation

tic-tac-toe with COBOL

GIF demoing gameplay in terminal

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.

About

writing a tic-tac-toe game in COBOL because i'm underemployed

Resources

Stars

Watchers

Forks

Languages