Difference between revisions of "MatLab Tic-Tac-Toe"
Line 16: | Line 16: | ||
=Design Process= | =Design Process= | ||
+ | |||
==Concept Sketch== | ==Concept Sketch== | ||
[[Image:Interface.jpg]] | [[Image:Interface.jpg]] | ||
+ | |||
==Implementation== | ==Implementation== | ||
1. GUIDE (Graphical User Interface Environment) | 1. GUIDE (Graphical User Interface Environment) | ||
− | + | --Overly complicated. Wrote unnessecary code that was incomprehensible with my limited experience. | |
− | + | --Also less accurate. I couldn't draw the buttons exactly where I wanted them, to a pixel. | |
+ | 2. Create programatically, using MatLab's help manual for instruction | ||
+ | |||
+ | ==Necessary Components== | ||
+ | 1. Parent Figure | ||
+ | 2. 9 "Game Grid" buttons | ||
+ | 3. "New Game" button | ||
+ | 4. "Quit" button | ||
+ | |||
+ | ==Problems/Solutions== | ||
+ | Global variables - must me declared as global in each function of your program | ||
+ | Callback functions - complicated methods for attaching to UI Buttons and passing arguments. Help manual explained callbacks in great depth. | ||
+ | |||
+ | ==Code== | ||
+ | [File:tttprog.m]] |
Revision as of 19:10, 10 December 2008
Contents
Members
Project Motivation
The primary purpose of this project is to learn how to create a graphical user interface (GUI) in MatLab and to become more comfortable programming in the MatLab language.
Project Descrition
MatLab has two primary methods for creating a GUI. It can be done progamatically or with MatLab's built-in toolset, GUIDE, which stands for Graphical User Interface Development Environment. I plan to explore both options, and make two final versions of the program, one using each of the methods. One goal is to implement as many elements of the MatLab GUI as possible.
Equipment
No equipment in addition to the software and a computer will be required.
Timelime
11/20-12/1 - Learn the various ways of implementing a GUI 12/1-12/8 - Implement the program
Design Process
Concept Sketch
Implementation
1. GUIDE (Graphical User Interface Environment) --Overly complicated. Wrote unnessecary code that was incomprehensible with my limited experience. --Also less accurate. I couldn't draw the buttons exactly where I wanted them, to a pixel. 2. Create programatically, using MatLab's help manual for instruction
Necessary Components
1. Parent Figure 2. 9 "Game Grid" buttons 3. "New Game" button 4. "Quit" button
Problems/Solutions
Global variables - must me declared as global in each function of your program Callback functions - complicated methods for attaching to UI Buttons and passing arguments. Help manual explained callbacks in great depth.
Code
[File:tttprog.m]]