Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Myclass update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:c0cd8ac6e6feff2eba4dea142375abee948c306a4de7e63aac247ddf9d198989
User & Date: sarah 2018-05-18 17:13:02
Context
2018-05-18
17:54
Who even knows what i did check-in: 78745a5066 user: sarah tags: trunk
17:13
Myclass update check-in: c0cd8ac6e6 user: sarah tags: trunk
15:43
New Class check-in: dcd84e93f9 user: sarah tags: trunk
Changes

Changes to finalproject/finalproject.cpp.

85
86
87
88
89
90
91
92
93

94
95
96

97
98

99
100
101
102

103
104
105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
                     break;
           }
      }
};
// DO NOT ALTER OR DELETE THIS CODE (END)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

class MyPickUpGame: public PickUpGame
{
      

      
void BondMove()
{ 

      
if ((xPos>0 )&& (xPos<41) && (yPos>0) && (yPos<21))

{
      
      
      Move(UserMove);

}

}


};

//You can modify and change main()
int main()
{

      PickUpGame* Game = new PickUpGame; //Create a new game object and store it in a object pointer

      char UserMove = ' '; //This is used to store the users input
      do {
           system("clear"); //Clear the screen before printing anything
           cout << "Welcome to cookie pickup. You will move to the cookies by using the arrow keys." << endl; //Program intro
           Game->Print(); //Print the grid out
           cout << "What direction would you like to move in? \n(Move using the arrow keys or type q to quit.) "; //Instructions to the user
           //UserMove = getche(); //Get one character from the user (some compilers have "getche()")
            system("/bin/stty raw"); 
           UserMove = getchar(); //Get one character from the user (Visual Studio 2010 "_getche()" is the new version of "getche()")
     	      system("/bin/stty cooked");
           Game->Move(UserMove); //Process the users input
      } while(UserMove != 'Q' && UserMove != 'q'); //Keep running the program until the user types in a Q or q

      system("clear"); //Clear the screen
      cout << endl;
      Game->Print(); //Print the final grid out to the user
      cout << endl;

      
      return 0;
}







|

>
|
<
|
>
|
<
>

|


>










>
|











|










85
86
87
88
89
90
91
92
93
94
95

96
97
98

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
                     break;
           }
      }
};
// DO NOT ALTER OR DELETE THIS CODE (END)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

class MyPickUpGame: public PickUpGame
{ public:  
      
void BoundedMove(char UserMove)
{ 


cout<<"xPos="<<xPos<<" yPos="<<yPos;


if ((xPos> 0)&& (xPos<20) || (yPos>0) || (yPos<40))
{
 
      
      Move(UserMove);
     
}

}


};

//You can modify and change main()
int main()
{

      MyPickUpGame* Game = new MyPickUpGame; //Create a new game object and store it in a object pointer

      char UserMove = ' '; //This is used to store the users input
      do {
           system("clear"); //Clear the screen before printing anything
           cout << "Welcome to cookie pickup. You will move to the cookies by using the arrow keys." << endl; //Program intro
           Game->Print(); //Print the grid out
           cout << "What direction would you like to move in? \n(Move using the arrow keys or type q to quit.) "; //Instructions to the user
           //UserMove = getche(); //Get one character from the user (some compilers have "getche()")
            system("/bin/stty raw"); 
           UserMove = getchar(); //Get one character from the user (Visual Studio 2010 "_getche()" is the new version of "getche()")
     	      system("/bin/stty cooked");
           Game->BoundedMove(UserMove); //Process the users input
      } while(UserMove != 'Q' && UserMove != 'q'); //Keep running the program until the user types in a Q or q

      system("clear"); //Clear the screen
      cout << endl;
      Game->Print(); //Print the final grid out to the user
      cout << endl;

      
      return 0;
}