File Exchange

image thumbnail

GUI to set up and score three sizes of tic-tac-toe

version 1.0.0.1 (5.51 KB) by Geoff Dutton
A hand-coded GUI with no callbacks. Functions pass and return a structure within event loops.

1 Download

Updated 01 Sep 2016

View Version History

View License

Straight tic-tac-toe, with options to play an opponent (not computer, which only keeps score) on 3x3, 4x4 and 5x5 boards. The first is of course trivial, the last two are impossible to win unless scoring can be done for sub-runs and blocks, which might be pretty interesting.
Fiddle with the scoring mechanism to see if you can make the larger games worth playing. I don't have time to spend on it. Then let me know if you got anywhere!

Seems to work on any MATLAB back to R14, when uipanels were introduced. The GUI does not really need its uipanel in any case.
Using event loops makes it possible to query uicontrols instead of having them issue callbacks. I am curious about how far such a model of user interaction might be able to go (i.e., how complicated a GUI can be before it absolutely needs callbacks).

Cite As

Geoff Dutton (2021). GUI to set up and score three sizes of tic-tac-toe (https://www.mathworks.com/matlabcentral/fileexchange/23577-gui-to-set-up-and-score-three-sizes-of-tic-tac-toe), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Shi vera

The game is common.
But when you win,it's shaking!
Wahaha...............
Lot's of fun!
Thanks for sharing

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!