-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (37 loc) · 821 Bytes
/
main.cpp
File metadata and controls
42 lines (37 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "matrix.h"
#include <iostream>
#include <iomanip>
#include <conio.h>
using namespace std;
/*
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
*/
int main(int argc, char *argv[])
{
Matrix* m = new Matrix();
unsigned char a;
while(1)
{
m->Show();
a=getch();
//for detect the function\arrow keys
//we must call the getch() again
//testing if a is '0' or '0xE0'
if (a==0 || a==0xE0) a=getch();
if (a==27) //ESC para sair
break;
else if (a==72)
m->SumToTop();
else if (a==80)
m->SumToBottom();
else if (a==75)
m->SumToLeft();
else if (a==77)
m->SumToRight();
else
cout<< "Char:"<<setw(4)<<(int)a;
}
return 0;
}