5阶魔方阵c语言程序设计,五阶魔方阵源代码c语言时课程设计.docx

五阶魔方阵源代码c语言时课程设计

主函数

#include

#include

#include

# include "wenjian.c"

# include "sanjie.c"

# include "sijie.c"

# include "wujie.c"

# include "donghua.c"

void dianz(void);

void upbar(int y);

void downbar(int y);

void banyuan(void);

void menulist(void)

{ int ky,cmd,i;

int y;

int gdriver,mode;

gdriver=DETECT;

initgraph(&gdriver,&mode,"");

setbkcolor(BLACK);

setcolor(RED);

/* rectangle(200,70,440,410); */

dianz();

y=127.5;

setwritemode(XOR_PUT);

upbar(y);

cmd=3;

do

{

ky=bioskey(0);

switch(ky)

{

case Key_3:

{ cmd=3;

ky=Key_ENTER;

break;

}

case Key_4:

{ cmd=4;

ky=Key_ENTER;

break;

}

case Key_5:

{ cmd=5;

ky=Key_ENTER;

break;

}

case Key_q: case Key_Q:

{ cmd=0;

ky=Key_ENTER;

break;

}

case Key_DOWN:

{ { if ( y<277.5 ){

upbar(y);

y+=75;

downbar(y);

cmd=cmd+1;

if(cmd==6)

cmd=0; }

}

break;

}

case Key_UP:

{ if(y>127.5){

{ downbar(y);

y-=75;

downbar(y);

if(cmd==0)

cmd=6;

cmd-=1;}

}

break;

}

}

} while (ky !=Key_ENTER );

switch(cmd)

{

case 0: exit(0);

case 3:

{

sanjie();

break;

}

case 4:

{

sijie();

break;

}

case 5:

{

wujie();

break;

}

}

}

main()

{ donghua();

while(1)

你可能感兴趣的:(5阶魔方阵c语言程序设计)