Computer Science Writing Tic Tac Toe - PowerPoint PPT Presentation

About This Presentation
Title:

Computer Science Writing Tic Tac Toe

Description:

Type: Chow. University of Utah School of Computing. University. of Utah. 4. GUI State ... We will now work on a recipe that someone could follow to play TicTacToe. ... – PowerPoint PPT presentation

Number of Views:230
Avg rating:3.0/5.0
Slides: 19
Provided by: Jim4220
Category:
Tags: chow | computer | recipe | science | tac | tic | toe | writing

less

Transcript and Presenter's Notes

Title: Computer Science Writing Tic Tac Toe


1
Computer Science Writing Tic Tac Toe
  • H. James de St. Germain
  • University of Utah

2
GUI vs. Game
  • Repeat after me
  • The GUI is not the Game
  • The GUI is not the Game
  • The STATE of the game is enough information to
    rebuild the game knowing nothing else.
  • It is easy to go from STATE?GUI.
  • It is very hard to go from GUI?STATE

3
State ? GUI
  • State
  • Dog
  • Height 2 ft
  • Weight 20 pds
  • Color aqua
  • Type Chow

4
GUI ? State
  • State????
  • What is it? How big? Color? Type?

5
Tic Tac Toe
  • Lets conceive of all the information and rules to
    tell someone else how to play
  • Tic Tac Toe

6
Assumptions
  • We have a function which will draw the game on
    the computer screen.

7
OBJECT
  • An object in Programming is a container of
    information.
  • class TicTacToe // is how it begins
  • What information is necessary to tell someone
    else the STATE of a game?

8
Example Pseudo Object
  • class Student
  • Name
  • Age
  • Uid
  • GPA
  • etc

9
Class TicTacToe
  • Fill in the class member variables here
  • But WAIT!
  • Member variables can only contain a few types
    of information

10
Data Types
  • Numbers
  • Characters
  • Booleans
  • Arrays (or Lists of information)
  • Objects (combinations of the above)

11
Class TicTacToe
  • Fill in the class member variables here
  • class TicTacToe

12
Computer as Scratch Paper
  • whos_turn

13
Actions (Algorithm)
  • We will now work on a recipe that someone could
    follow to play TicTacToe.
  • Remember, all references to the STATE of the game
    must refer to our member variables on the
    previous slide.

14
TicTacToe Algorithm
15
Recap
  • All instructions in an algorithm must refer to
    the DATA stored in variables
  • All variables have a specific DATA TYPE limiting
    what they can store
  • A computers memory is like a piece of paper with
    little boxes on it.

16
Final Thought
  • When writing a computer program, you should be
    able to write down a list of instructions that
    your friend can follow without you to explain
    anything

17
Questions
  • Discussion!

18
  • Fin
Write a Comment
User Comments (0)
About PowerShow.com