Skip to content

Commit

Permalink
Drawarea and divide into 2 area
Browse files Browse the repository at this point in the history
  • Loading branch information
LaoshuBaby committed Dec 15, 2020
1 parent d1f06ee commit 8b351a8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
x64
.vs/STUAT_SchuduleIntersector/v15/Browse.VC.db
*.suo
*.ipch
.vs/STUAT_SchuduleIntersector/v15/.suo
44 changes: 31 additions & 13 deletions STUAT_SchuduleIntersector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,52 @@
#include <conio.h>
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");
Expand Down

0 comments on commit 8b351a8

Please sign in to comment.