Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <windows.h>
- #include <stdlib.h>
- void f(char c, short x, short y, short color) {
- HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- COORD coord = { x, y };
- SetConsoleTextAttribute(hConsole, color);
- SetConsoleCursorPosition(hConsole, coord);
- printf("%c", c);
- Sleep(0);
- }
- int main() {
- int col = 2;
- int s = 79;
- for (int i = 2; i < 78; i++) {
- for (int j = 2; j < 18; j++) {
- f(s, i, j, rand(4));
- }
- }
- for (int i = 1; i < 20; i++) {
- s = 124;
- f(s, 1, i, col);
- f(s, 79, i, col);
- }
- for (int i = 1; i < 80; i++) {
- s = 45;
- f(s, i, 1, col);
- f(s, i, 19, col);
- }
- s = 79;
- f(s, 0, 0, col);
- f(s, 80, 0, col);
- f(s, 80, 20, col);
- f(s, 0, 20, col);
- s = 65;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement