GUI to set up and score three sizes of tic-tac-toe
by Geoff Dutton
07 Apr 2009
A hand-coded GUI with no callbacks. Functions pass and return a structure within event loops.
|
Watch this File
|
| File Information |
| Description |
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). |
| MATLAB release |
MATLAB 7.0.1 (R14SP1)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (1) |
| 16 Apr 2009 |
Shi vera
|
|
|
|
Contact us at files@mathworks.com