Alpha-Beta Game Tree Search Demo - Tic-Tac-Toe

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Hutchboy
Posts: 116
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Alpha-Beta Game Tree Search Demo - Tic-Tac-Toe

Post by Hutchboy » Fri Aug 08, 2025 7:24 pm

Hi,

I was browsing through some old issues of MacUser Magazine and found an interesting article on a game tree search algorithm. Attached is the demo and a tutorial file I included. The demo is the use of the algorithm in a simple Tic-Tac-Toe game.

I could have put the game button scripts in a behavior or used a "target" strategy and case statements but didn't in this version so check the mouseUp scripts attached to each game board button.

One little annoyance was trying to initialize the game board button labels to be empty. I had to use a "-" character because trying to use "empty" or "" to set the label didn't work. Kind of surprising I haven't run across this before. Am I missing something?

- Mike
Attachments
alphabeta_tutorial.html.zip
(4.37 KiB) Downloaded 19 times
Alpha-Beta Algorithm Demo.livecode.zip
(5.54 KiB) Downloaded 18 times

Post Reply