-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole.tests.cpp
More file actions
executable file
·34 lines (30 loc) · 931 Bytes
/
console.tests.cpp
File metadata and controls
executable file
·34 lines (30 loc) · 931 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
#include "console.h"
#include <iostream>
#include <string.h>
#ifdef __WIN32
int wmain() {
#else
int main() {
#endif
console::clear();
char buffer[256];
memset(buffer, '\0', sizeof(buffer) / sizeof(typeof(buffer[0])));
sprintf(&buffer[0], "Width: %i, Height: %i", console::getConsoleWidth(), console::getConsoleHeight());
char cur = buffer[0];
int i = 0;
int cwidth = console::getConsoleWidth(), cheight = console::getConsoleHeight();
int ypos = 1;
for (i = 0; i < 256; i++) {
console::write(i % cwidth, (i / cwidth + ypos) % cheight, '#', (i % 16) | ((((i) / 16) % 16) << 4));
}
ypos += (256 / cwidth) + 2;
for (i = 0; i < 256; i++) {
console::write(i % cwidth, (i / cwidth + ypos) % cheight, '*', (i % 16) | (((i / 16) % 16) << 4));
}
ypos += (256 / cwidth) + 2;
for (i = 0; i < 64; i++) {
console::write(i % cwidth, (i / cwidth + ypos) % cheight, L'░', i << 4);
}
console::readKey();
return 0;
}