Code covered by the BSD License  

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

5.0

5.0 | 1 rating Rate this file 12 Downloads (last 30 days) File Size: 5.51 KB File ID: #23577
image thumbnail

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

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

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
games Geoff Dutton 07 Apr 2009 11:40:10
gui Geoff Dutton 07 Apr 2009 11:40:10
callbacks Geoff Dutton 07 Apr 2009 11:40:10
tictactoe Geoff Dutton 14 Apr 2009 12:33:30
data structure Geoff Dutton 14 Apr 2009 12:33:30

Contact us at files@mathworks.com