CSC112 Spring 2016 Examples
#include <unistd.h>1#include "termmanip.h"2#include "SmileyFace.h"3#include "keystream.h"45using namespace std;678int main()9{10SmileyFace *face = new SmileyFace(42, 10); //put the smiley near the middle!11keycode c;1213kin.rawMode();1415//clear the screen and display the menu16cout << clearScreen << cursorOff;17cout << cursorPosition(1,1)18<< "Q - Scare C - Chill Z - Kill UP - Reset ESC - Exit";19cout.flush();2021//draw the initial smiley22face->display();2324do {25c = kin.getKey();26switch(c) {27case 'q':28case 'Q':29face->scare();30break;3132case 'c':33case 'C':34face->chill();35break;3637case 'z':38case 'Z':39face->kill();40break;4142case UP:43face->reset();44break;45}4647face->display();48} while(c != ESC);4950return 0;51}525354