-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotter.h
47 lines (38 loc) · 1.01 KB
/
plotter.h
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
43
44
45
46
47
#ifndef PLOTTER_H_
#define PLOTTER_H_
#include <windows.h>
#include <mmsystem.h>
#include <conio.h>
const unsigned char SQUARE = 219;
const unsigned char LEFT = 221;
const unsigned char RIGHT = 222;
const unsigned char TOP = 223;
const unsigned char BOTTOM = 220;
const unsigned char BLANK = ' ';
const unsigned char SNOWMAN = '*';
enum key
{
vk_left = 75, vk_right = 77, vk_up = 72, vk_down = 80
};
enum ink
{
black = 0x00, darkblue = 0x01, darkgreen = 0x02, darkcyan = 0x03,
darkred = 0x04, purple = 0x05, darkyellow = 0x06, lightgrey = 0x07,
grey = 0x08, blue = 0x09, green = 0x0A, cyan = 0x0B,
red = 0x0C, magenta = 0x0D, yellow = 0x0E, white = 0x0F
};
class Plotter
{
protected:
COORD coordScreen;
HANDLE hConsoleOutput;
char dummy;
void cls( HANDLE hConsole );
public:
Plotter();
void clear();
void move(int, int);
void plot(int,int,char);
void setColor(ink);
};
#endif /*PLOTTER_H_*/