Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <conio.h>
- #include <vector>
- #include <ctime>
- #include <string>
- using namespace std;
- int circle[60][2] = {{11,0},{12,0},{13,0},{14,1},{15,1},{16,2},{17,2},{18,3},{18,4},{19,5},{20,6},{20,7},{21,8},{21,9},{21,10},{21,11},{21,12},{21,13},{20,14},{20,15},{19,16},{19,17},{18,18},{17,19},{16,19},{15,20},{14,20},{13,21},{12,21},{11,21},{10,21},{9,21},{8,21},{7,20},{6,20},{5,19},{4,18},{3,18},{2,17},{2,16},{1,15},{1,14},{0,13},{0,12},{0,11},{0,10},{0,9},{0,8},{1,7},{1,6},{2,5},{2,4},{3,3},{4,2},{5,2},{6,1},{7,1},{8,0},{9,0},{10,0}};
- int seconds[60][25][2] =
- {
- {
- {10,10},
- {10,9},
- {10,8},
- {10,7},
- {10,6},
- {10,5},
- {10,4},
- {10,3},
- {10,2}
- },
- {
- {11,10},
- {11,9},
- {11,8},
- {11,7},
- {11,6},
- {11,5},
- {11,4},
- {11,3},
- {11,2}
- },
- {
- {11,10},
- {11,9},
- {11,8},
- {11,7},
- {11,6},
- {12,5},
- {12,4},
- {12,3},
- {12,2},
- {12,1}
- },
- {
- {11,10},
- {11,9},
- {11,8},
- {12,7},
- {12,6},
- {12,5},
- {12,4},
- {13,3},
- {13,2},
- {13,1}
- },
- {
- {11,10},
- {11,9},
- {12,8},
- {12,7},
- {13,6},
- {13,5},
- {13,4},
- {14,3},
- {14,2}
- },
- {
- {11,10},
- {12,9},
- {12,8},
- {13,7},
- {13,6},
- {14,5},
- {14,4},
- {15,3}
- },
- {
- {11,10},
- {12,9},
- {12,8},
- {13,7},
- {14,6},
- {15,5},
- {15,4}
- },
- {
- {11,10},
- {12,9},
- {13,8},
- {14,7},
- {14,6},
- {15,5},
- {16,4},
- {17,3}
- },
- {
- {11,10},
- {12,9},
- {13,8},
- {14,7},
- {15,6},
- {16,5},
- {17,4}
- },
- {
- {11,10},
- {12,9},
- {13,9},
- {14,8},
- {15,7},
- {16,6},
- {17,6},
- {18,5}
- },
- {
- {11,10},
- {12,9},
- {13,9},
- {14,8},
- {15,8},
- {16,7},
- {17,7}
- },
- {
- {11,10},
- {12,10},
- {13,9},
- {14,9},
- {15,8},
- {16,8},
- {17,7},
- {18,7},
- {19,6}
- },
- {
- {11,10},
- {12,10},
- {13,9},
- {14,9},
- {15,9},
- {16,8},
- {17,8},
- {18,7},
- {19,7}
- },
- {
- {11,10},
- {12,10},
- {13,10},
- {14,9},
- {15,9},
- {16,9},
- {17,9},
- {18,8},
- {19,8},
- {20,8}
- },
- {
- {11,10},
- {12,10},
- {13,10},
- {14,10},
- {15,10},
- {16,9},
- {17,9},
- {18,9},
- {19,9},
- {20,9}
- },
- {
- {11,10},
- {12,10},
- {13,10},
- {14,10},
- {15,10},
- {16,10},
- {17,10},
- {18,10},
- {19,10}
- },
- {
- {11,11},
- {12,11},
- {13,11},
- {14,11},
- {15,11},
- {16,11},
- {17,11},
- {18,11},
- {19,11},
- {20,11}
- },
- {
- {11,11},
- {12,11},
- {13,11},
- {14,11},
- {15,11},
- {16,12},
- {17,12},
- {18,12},
- {19,12},
- {20,12}
- },
- {
- {11,11},
- {12,11},
- {13,11},
- {14,12},
- {15,12},
- {16,12},
- {17,12},
- {18,13},
- {19,13},
- {20,13}
- },
- {
- {11,11},
- {12,11},
- {13,12},
- {14,12},
- {15,12},
- {16,13},
- {17,13},
- {18,14},
- {19,14}
- },
- {
- {11,11},
- {12,11},
- {13,12},
- {14,12},
- {15,13},
- {16,13},
- {17,14},
- {18,14},
- {19,15}
- },
- {
- {11,11},
- {12,12},
- {13,12},
- {14,13},
- {15,14},
- {16,15},
- {17,15},
- {18,16}
- },
- {
- {11,11},
- {12,12},
- {13,13},
- {14,14},
- {15,14},
- {16,15},
- {17,16},
- {18,17}
- },
- {
- {11,11},
- {12,12},
- {13,13},
- {14,14},
- {15,15},
- {16,16},
- {17,17}
- },
- {
- {11,11},
- {12,12},
- {13,13},
- {14,14},
- {14,15},
- {15,16},
- {16,17},
- {17,18}
- },
- {
- {11,11},
- {12,12},
- {12,13},
- {13,14},
- {14,15},
- {15,16},
- {15,17},
- {16,18}
- },
- {
- {11,11},
- {11,12},
- {12,13},
- {12,14},
- {13,15},
- {13,16},
- {14,17},
- {14,18},
- {15,19}
- },
- {
- {11,11},
- {11,12},
- {12,13},
- {12,14},
- {12,15},
- {13,16},
- {13,17},
- {14,18},
- {14,19}
- },
- {
- {11,11},
- {11,12},
- {11,13},
- {12,14},
- {12,15},
- {12,16},
- {12,17},
- {13,18},
- {13,19},
- {13,20}
- },
- {
- {11,11},
- {11,12},
- {11,13},
- {11,14},
- {11,15},
- {12,16},
- {12,17},
- {12,18},
- {12,19},
- {12,20}
- },
- {
- {11,11},
- {11,12},
- {11,13},
- {11,14},
- {11,15},
- {11,16},
- {11,17},
- {11,18},
- {11,19}
- },
- {
- {10,11},
- {10,12},
- {10,13},
- {10,14},
- {10,15},
- {10,16},
- {10,17},
- {10,18},
- {10,19}
- },
- {
- {10,11},
- {10,12},
- {10,13},
- {10,14},
- {10,15},
- {9,16},
- {9,17},
- {9,18},
- {9,19},
- {9,20}
- },
- {
- {10,11},
- {10,12},
- {10,13},
- {9,14},
- {9,15},
- {9,16},
- {9,17},
- {8,18},
- {8,19},
- {8,20}
- },
- {
- {10,11},
- {10,12},
- {9,13},
- {9,14},
- {9,15},
- {8,15},
- {8,16},
- {8,17},
- {7,18},
- {7,19}
- },
- {
- {10,11},
- {10,12},
- {9,13},
- {9,14},
- {9,15},
- {8,15},
- {8,16},
- {7,16},
- {7,17},
- {6,19}
- },
- {
- {10,11},
- {10,12},
- {9,13},
- {9,14},
- {8,14},
- {8,15},
- {7,16},
- {7,17}
- },
- {
- {10,11},
- {10,12},
- {9,12},
- {9,13},
- {8,13},
- {8,14},
- {7,15},
- {7,16},
- {6,16},
- {6,17},
- {5,17},
- {5,18}
- },
- {
- {10,11},
- {9,12},
- {8,13},
- {7,14},
- {6,15},
- {5,16},
- {4,17}
- },
- {
- {10,11},
- {9,12},
- {8,13},
- {7,13},
- {7,14},
- {6,14},
- {6,15},
- {5,15},
- {4,16},
- {3,17}
- },
- {
- {10,11},
- {9,12},
- {8,12},
- {8,13},
- {7,13},
- {6,14},
- {5,14},
- {5,15},
- {4,16},
- {3,16}
- },
- {
- {10,11},
- {9,11},
- {7,12},
- {8,12},
- {6,13},
- {7,13},
- {4,14},
- {5,14},
- {2,15}
- },
- {
- {10,11},
- {9,11},
- {6,12},
- {7,12},
- {8,12},
- {6,13},
- {5,13},
- {4,13},
- {3,14},
- {2,14}
- },
- {
- {10,11},
- {9,11},
- {8,11},
- {6,12},
- {7,12},
- {5,12},
- {4,12},
- {3,13},
- {2,13},
- {1,13}
- },
- {
- {10,11},
- {9,11},
- {8,11},
- {7,11},
- {6,11},
- {5,12},
- {4,12},
- {3,12},
- {2,12},
- {1,12}
- },
- {
- {10,11},
- {9,11},
- {8,11},
- {7,11},
- {6,11},
- {5,11},
- {4,11},
- {3,11},
- {2,11},
- {1,11}
- },
- {
- {10,10},
- {9,10},
- {8,10},
- {7,10},
- {6,10},
- {5,10},
- {4,10},
- {3,10},
- {2,10}
- },
- {
- {10,10},
- {9,10},
- {8,10},
- {7,10},
- {6,10},
- {5,9},
- {4,9},
- {3,9},
- {2,9},
- {1,9}
- },
- {
- {10,10},
- {9,10},
- {8,10},
- {7,9},
- {6,9},
- {5,9},
- {4,9},
- {3,8},
- {2,8},
- {1,8}
- },
- {
- {10,10},
- {9,10},
- {8,9},
- {7,9},
- {6,8},
- {5,8},
- {4,8},
- {3,7},
- {2,7}
- },
- {
- {10,10},
- {9,9},
- {8,9},
- {7,8},
- {6,8},
- {5,7},
- {4,7},
- {2,6}
- },
- {
- {10,10},
- {9,9},
- {8,9},
- {7,8},
- {6,7},
- {5,6},
- {4,6},
- {3,5}
- },
- {
- {10,10},
- {9,9},
- {8,8},
- {7,7},
- {6,7},
- {5,6},
- {4,5},
- {3,4}
- },
- {
- {10,10},
- {9,9},
- {8,8},
- {7,7},
- {6,6},
- {5,5}
- },
- {
- {10,10},
- {9,9},
- {8,8},
- {7,7},
- {7,6},
- {6,5},
- {5,4},
- {4,3}
- },
- {
- {10,10},
- {9,9},
- {9,8},
- {8,7},
- {7,6},
- {6,5},
- {6,4}
- },
- {
- {10,10},
- {9,9},
- {9,8},
- {8,7},
- {8,6},
- {7,5},
- {7,4},
- {6,3},
- {6,2}
- },
- {
- {10,10},
- {10,9},
- {9,8},
- {9,7},
- {8,6},
- {8,5},
- {8,4},
- {7,3},
- {7,2}
- },
- {
- {10,10},
- {10,9},
- {10,8},
- {9,7},
- {9,6},
- {9,5},
- {9,4},
- {8,3},
- {8,2},
- {8,1}
- },
- {
- {10,10},
- {10,9},
- {10,8},
- {10,7},
- {10,6},
- {9,5},
- {9,4},
- {9,3},
- {9,2},
- {9,1}
- }
- };
- int hours[12][5][2] =
- {
- {
- {11,10},
- {11,9},
- {11,8},
- {11,7},
- {11,6}
- },
- {
- {11,10},
- {12,9},
- {12,8},
- {13,7},
- {13,6}
- },
- {
- {11,10},
- {12,9},
- {13,9},
- {14,8},
- {15,8}
- },
- {
- {11,10},
- {12,10},
- {13,10},
- {14,10},
- {15,10}
- },
- {
- {11,11},
- {12,12},
- {13,12},
- {14,13},
- {15,13}
- },
- {
- {11,11},
- {12,12},
- {12,13},
- {13,14},
- {13,15}
- },
- {
- {11,11},
- {11,12},
- {11,13},
- {11,14},
- {11,15}
- },
- {
- {10,11},
- {9,12},
- {9,13},
- {8,14},
- {8,15}
- },
- {
- {10,11},
- {9,12},
- {8,12},
- {7,13},
- {6,13}
- },
- {
- {10,10},
- {9,10},
- {8,10},
- {7,10},
- {6,10}
- },
- {
- {10,10},
- {9,9},
- {8,9},
- {7,8},
- {6,8}
- },
- {
- {10,10},
- {9,9},
- {9,8},
- {8,7},
- {7,6}
- }
- };
- char digital[13][5][18]=
- {
- {
- {" __ "},
- {" / \\ "},
- {"| |"},
- {"| |"},
- {" \\__/ "}
- },
- {
- {" , "},
- {" /| "},
- {" | "},
- {" | "},
- {" | "}
- },
- {
- {" __ "},
- {" / ) "},
- {" / "},
- {" / "},
- {" /___ "}
- },
- {
- {" ___ "},
- {" / \\"},
- {" __/"},
- {" \\"},
- {" \\___/"}
- },
- {
- {" "},
- {" | | "},
- {" |__|_"},
- {" | "},
- {" | "}
- },
- {
- {" ____"},
- {" | "},
- {" |___ "},
- {" \\"},
- {" \\___/"}
- },
- {
- {" __ "},
- {" / "},
- {" | __ "},
- {" |/ \\"},
- {" \\__/"}
- },
- {
- {" _____"},
- {" /"},
- {" / "},
- {" / "},
- {" / "}
- },
- {
- {" __ "},
- {" / \\ "},
- {" \\__/ "},
- {" / \\ "},
- {" \\__/ "}
- },
- {
- {" __ "},
- {" / | "},
- {" \\_/| "},
- {" | "},
- {" | "}
- },
- {
- {" "},
- {" _ "},
- {"(_)"},
- {" _ "},
- {"(_)"}
- },
- {
- {" _ __ __ "},
- {" / \\ | \\/ |"},
- {" / _ \\ | |\\/| |"},
- {" / ___ \\ | | | |"},
- {"/_/ \\_\\|_| |_|"}
- },
- {
- {" ____ __ __ "},
- {" | _ \\ | \\/ |"},
- {" | |_) | | |\\/| |"},
- {" | __/ | | | |"},
- {" |_| |_| |_|"}
- }
- };
- void fontsize(int,int);
- void gotoxy(int x, int y)
- {
- COORD coord;
- coord.X = x;
- coord.Y = y;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
- }
- void rendercicle()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11);
- for(int x = 0; x < 60; x++)
- {
- gotoxy(((circle[x][0]*2)+22),(circle[x][1]+2));
- cout << "\xb0\xb0";
- }
- }
- void renderdigitalss(int ss)
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
- if(ss < 10)
- {
- for(int x = 0; x<5;x++)
- {
- gotoxy(41,25+x);
- for(int y = 0; digital[0][x][y] != '\0';y++)
- {
- cout<<digital[0][x][y];
- }
- cout<<" ";
- for(int y = 0; digital[ss][x][y] != '\0';y++)
- {
- cout<<digital[ss][x][y];
- }
- }
- }
- else
- {
- for(int x = 0; x<5;x++)
- {
- gotoxy(41,25+x);
- for(int y = 0; digital[(ss/10)%10][x][y] != '\0';y++)
- {
- cout<<digital[(ss/10)%10][x][y];
- }
- cout<<" ";
- for(int y = 0; digital[ss%10][x][y] != '\0';y++)
- {
- cout<<digital[ss%10][x][y];
- }
- }
- }
- }
- void renderdigitalmm(int mm)
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14);
- if(mm < 10)
- {
- for(int x = 0; x<5;x++)
- {
- gotoxy(21,25+x);
- for(int y = 0; digital[0][x][y] != '\0';y++)
- {
- cout<<digital[0][x][y];
- }
- cout<<" ";
- for(int y = 0; digital[mm][x][y] != '\0';y++)
- {
- cout<<digital[mm][x][y];
- }
- }
- }
- else
- {
- for(int x = 0; x<5;x++)
- {
- gotoxy(21,25+x);
- for(int y = 0; digital[(mm/10)%10][x][y] != '\0';y++)
- {
- cout<<digital[(mm/10)%10][x][y];
- }
- cout<<" ";
- for(int y = 0; digital[mm%10][x][y] != '\0';y++)
- {
- cout<<digital[mm%10][x][y];
- }
- }
- }
- }
- void renderdigitalhh(int hh)
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),13);
- if(hh < 10)
- {
- for(int x = 0; x<5;x++)
- {
- gotoxy(1,25+x);
- for(int y = 0; digital[0][x][y] != '\0';y++)
- {
- cout<<digital[0][x][y];
- }
- cout<<" ";
- for(int y = 0; digital[hh][x][y] != '\0';y++)
- {
- cout<<digital[hh][x][y];
- }
- }
- }
- else
- {
- for(int x = 0; x<5;x++)
- {
- gotoxy(1,25+x);
- for(int y = 0; digital[(hh/10)%10][x][y] != '\0';y++)
- {
- cout<<digital[(hh/10)%10][x][y];
- }
- cout<<" ";
- for(int y = 0; digital[hh%10][x][y] != '\0';y++)
- {
- cout<<digital[hh%10][x][y];
- }
- }
- }
- }
- void renderdigitalapm(int apm)
- {
- for(int x = 0; x<5;x++)
- {
- gotoxy(57,25+x);
- if(apm>12)
- {
- for(int y = 0; digital[12][x][y] != '\0';y++)
- {
- cout<<digital[12][x][y];
- }
- }
- else
- {
- for(int y = 0; digital[11][x][y] != '\0';y++)
- {
- cout<<digital[11][x][y];
- }
- }
- }
- }
- void renderdigital()
- {
- for(int x = 0; x<5;x++)
- {
- gotoxy(16,25+x);
- for(int y = 0; digital[10][x][y] != '\0';y++)
- {
- cout<<digital[10][x][y];
- }
- }
- for(int x = 0; x<5;x++)
- {
- gotoxy(36,25+x);
- for(int y = 0; digital[10][x][y] != '\0';y++)
- {
- cout<<digital[10][x][y];
- }
- }
- }
- void renderhands()
- {
- time_t t = time(0);
- tm* now = localtime(&t);
- int x = now->tm_sec;
- int xx = now->tm_min;
- int xxx = (now->tm_hour)%11;
- renderdigitalss(x);
- renderdigitalmm(xx);
- renderdigitalhh(xxx);
- renderdigitalapm(xxx);
- while(true)
- {
- xxx = xxx%11;
- for(int y = 0;y<5;y++)
- {
- if(hours[xxx][y][0] == 0 && hours[xxx][y][1] == 0)
- {
- continue;
- }
- gotoxy(((hours[xxx][y][0]*2)+22),(hours[xxx][y][1]+2));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),13);
- cout << "hh";
- }
- for(int y = 0;y<10;y++)
- {
- if(seconds[xx][y][0] == 0 && seconds[xx][y][1] == 0)
- {
- continue;
- }
- gotoxy(((seconds[xx][y][0]*2)+22),(seconds[xx][y][1]+2));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14);
- cout << "mm";
- }
- for(int y = 0;y<25;y++)
- {
- if(seconds[x][y][0] == 0 && seconds[x][y][1] == 0)
- {
- continue;
- }
- gotoxy(((seconds[x][y][0]*2)+22),(seconds[x][y][1]+2));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
- cout << "s";
- }
- Sleep(1000);
- for(int y = 0;y<5;y++)
- {
- if(hours[xxx][y][0] == 0 && hours[xxx][y][1] == 0)
- {
- continue;
- }
- gotoxy(((hours[(xxx - 1)][y][0]*2)+22),(hours[(xxx-1)][y][1]+2));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),13);
- cout << " ";
- }
- for(int y = 0;y<10;y++)
- {
- if(seconds[xx][y][0] == 0 && seconds[xx][y][1] == 0)
- {
- continue;
- }
- gotoxy(((seconds[xx][y][0]*2)+22),(seconds[xx][y][1]+2));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),14);
- cout << " ";
- }
- for(int y = 0;y<25;y++)
- {
- if(seconds[x][y][0] == 0 && seconds[x][y][1] == 0)
- {
- continue;
- }
- gotoxy(((seconds[x][y][0]*2)+22),(seconds[x][y][1]+2));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15);
- cout << " ";
- }
- if(x == 59)
- {
- time_t t = time(0);
- tm* now = localtime(&t);
- x = now->tm_sec;
- xx = now->tm_min;
- renderdigitalss(x);
- renderdigitalmm(xx);
- }
- else
- {
- time_t t = time(0);
- tm* now = localtime(&t);
- x = now->tm_sec;
- renderdigitalss(x);
- }
- if(xx==60)
- {
- xx=0;
- time_t t = time(0);
- tm* now = localtime(&t);
- xxx = now->tm_hour;
- renderdigitalapm(xxx);
- renderdigitalhh(xxx%11);
- }
- }
- }
- void rendernumbers()
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),12);
- gotoxy(43,3);
- cout << "12";
- gotoxy(52,4);
- cout << "01";
- gotoxy(58,8);
- cout << "02";
- gotoxy(62,12);
- cout << "03";
- gotoxy(58,17);
- cout << "04";
- gotoxy(52,20);
- cout << "05";
- gotoxy(43,22);
- cout << "06";
- gotoxy(34,20);
- cout << "07";
- gotoxy(28,17);
- cout << "08";
- gotoxy(24,12);
- cout << "09";
- gotoxy(28,8);
- cout << "10";
- gotoxy(32,5);
- cout << "11";
- }
- int main()
- {
- system("mode con:cols=88 lines=50");
- HWND consoleWindow = GetConsoleWindow();
- SetWindowPos( consoleWindow, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER );
- fontsize(30,15);
- rendercicle();
- rendernumbers();
- renderdigital();
- renderhands();
- getch();
- return 0;
- }
- void fontsize(int a, int b){
- PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx = new CONSOLE_FONT_INFOEX();
- lpConsoleCurrentFontEx->cbSize = sizeof(CONSOLE_FONT_INFOEX);
- GetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), 0, lpConsoleCurrentFontEx);
- lpConsoleCurrentFontEx->dwFontSize.X = a;
- lpConsoleCurrentFontEx->dwFontSize.Y = b;
- SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), 0, lpConsoleCurrentFontEx);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement