From 8b351a89697c1f86d22f810786cfdcb34a84f652 Mon Sep 17 00:00:00 2001 From: LaoshuBaby Date: Tue, 15 Dec 2020 17:43:35 +0800 Subject: [PATCH] Drawarea and divide into 2 area --- .gitignore | 1 + STUAT_SchuduleIntersector.cpp | 44 ++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 5fcc598..fe9e7aa 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ x64 .vs/STUAT_SchuduleIntersector/v15/Browse.VC.db *.suo +*.ipch .vs/STUAT_SchuduleIntersector/v15/.suo diff --git a/STUAT_SchuduleIntersector.cpp b/STUAT_SchuduleIntersector.cpp index cf529e9..a4ab590 100644 --- a/STUAT_SchuduleIntersector.cpp +++ b/STUAT_SchuduleIntersector.cpp @@ -4,34 +4,52 @@ #include using namespace std; -#define WINDOW_W 1920*0.75 -#define WINDOW_H 1080*0.75 +#define WINDOW_W 1500 +#define WINDOW_H 780 -#define BLOCK_W 150 -#define BLOCK_H 80 -#define BLOCK_DAY 7 -#define BLOCK_CLASS 5+5+3 +#define BLOCK_W 175 +#define BLOCK_H 55 + +#define NUM_DAY 7 +#define NUM_CLASS 5+5+3 void WindowMain(void) { - setfillcolor(DARKGRAY); + //----INIT---- + + //DEFINE PLAYGROUND + setfillcolor(BLACK); solidrectangle(0, 0, WINDOW_W, WINDOW_H); - int BlockL = 50; - int BlockU = 100; + //DEFINE TABLEAREA + setfillcolor(DARKGRAY); + solidrectangle(0, 0, 1295, 780); + //DEFINE CONTROLAREA + setfillcolor(LIGHTGRAY); + solidrectangle(1296, 0, 1500, 780); + + int TABLE_EDGE_X = 30; + int TABLE_EDGE_Y = 30; + int iterator_i = 0; int iterator_j = 0; - for (iterator_i = 0; iterator_i < BLOCK_DAY; ++iterator_i) + + //DIVISION LINE + rectangle(TABLE_EDGE_X * 2 + BLOCK_W * 7 + 10, 30, TABLE_EDGE_X * 2 + BLOCK_W * 7 + 10 + 1, WINDOW_H - 30); + + //----TABLEAREA---- + + for (iterator_i = 0; iterator_i < NUM_DAY; ++iterator_i) { - for (iterator_j = 0; iterator_j < BLOCK_CLASS; ++iterator_j) + for (iterator_j = 0; iterator_j < NUM_CLASS; ++iterator_j) { - rectangle(iterator_i*BLOCK_W, iterator_j*BLOCK_H, (iterator_i + 1)*BLOCK_W, (iterator_j + 1)*BLOCK_H); + rectangle(TABLE_EDGE_X + iterator_i * BLOCK_W, TABLE_EDGE_Y + iterator_j * BLOCK_H, TABLE_EDGE_X + (iterator_i + 1)*BLOCK_W, TABLE_EDGE_Y + (iterator_j + 1)*BLOCK_H); } } + } int main() { - //std::cout << "Hello World!\n"; initgraph(WINDOW_W, WINDOW_H, SHOWCONSOLE); WindowMain(); system("PAUSE");