Notes1 - Wednesday November 28 <-3-2-1-0-1-2-3-4-5-> abstraction information hiding what is the game program going to be doing with targets struct

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Wednesday November 28 <---(-3)--(-2)--(-1)--0--1--2--3--4--5----> abstraction: information hiding what is the game program going to be doing with targets? struct Target { ... }; Pseudocode move (char dir) // move the target in the indicated position replayHistory() // replay the history int position() // return the target's position Say you have a target object t2 nothing stops any part of the program from saying t2.history="LQ?35xx!" what if you say cout<<t.pos; cout<<t.position(); but you change the data members instead  to create special compile errors to stop certain changes - certain functions allowed to change - these functions declared inside the declaration of your structure type - soo: struct Target {  public:   void move(char dir); //  member functions , operations, 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
  void replayHistory(); // or methods   private:   int pos; //  data  members, or instance    string history; // variables, or attributes
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/02/2008 for the course COM SCI 31 taught by Professor Kinsey during the Fall '98 term at UCLA.

Page1 / 5

Notes1 - Wednesday November 28 <-3-2-1-0-1-2-3-4-5-> abstraction information hiding what is the game program going to be doing with targets struct

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online