魔方算法源代碼

魔方算法源代碼

ID:41206404

大小:96.50 KB

頁數(shù):19頁

時間:2019-08-18

魔方算法源代碼_第1頁
魔方算法源代碼_第2頁
魔方算法源代碼_第3頁
魔方算法源代碼_第4頁
魔方算法源代碼_第5頁
資源描述:

《魔方算法源代碼》由會員上傳分享,免費在線閱讀,更多相關內容在行業(yè)資料-天天文庫。

1、#include"graphics.h"#include"stdio.h"intcolor[6][9]={4,4,4,4,4,4,4,4,4,2,2,2,2,2,2,2,2,2,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,7,7,7,7,7,7,7,7,7,9,9,9,9,9,9,9,9,9};intcolumn[6][9]={195,255,315,345,375,315,255,225,285,180,180,180,240,300,300,300,240,240,345,345,345,37

2、5,405,405,405,375,375,470,470,470,530,590,590,590,530,530,55,55,55,85,115,115,115,85,85,195,255,315,345,375,315,255,225,285};introw[6][9]={135,135,135,105,75,75,75,105,105,180,240,300,300,300,240,180,180,240,165,225,285,255,225,165,105,135,185,90,150,210,210,210,150,90,90,150,165,22

3、5,285,255,225,165,105,135,185,425,425,425,395,365,365,365,395,395};voidboxinit(){setcolor(CYAN);moveto(150,150);lineto(330,150);line(150,210,330,210);line(150,270,330,270);line(150,330,330,330);line(180,120,360,120);line(210,90,390,90);line(240,60,420,60);line(360,120,360,300);line(

4、390,90,390,270);line(420,60,420,240);line(330,210,420,120);line(330,270,420,180);line(330,330,420,240);line(330,150,420,60);line(330,150,330,330);line(270,150,270,330);line(210,150,210,330);line(150,150,150,330);line(150,150,240,60);line(210,150,300,60);line(270,150,360,60);moveto(4

5、0,150);lineto(130,60);lineto(130,240);lineto(40,330);lineto(40,150);line(70,120,70,300);line(100,90,100,270);line(40,210,130,120);line(40,270,130,180);moveto(440,60);lineto(620,60);lineto(620,240);lineto(440,240);lineto(440,60);line(440,120,620,120);line(440,180,620,180);line(500,60

6、,500,240);line(560,60,560,240);moveto(150,440);lineto(330,440);lineto(420,350);lineto(240,350);lineto(150,440);line(210,440,300,350);line(270,440,360,350);line(180,410,360,410);line(210,380,390,380);}voidtemp(){delay(1);}voidupcolor(){inti,j;for(i=0;i<6;i++)for(j=0;j<9;j++){setfills

7、tyle(1,color[i][j]);floodfill(column[i][j],row[i][j],CYAN);temp();}}//該函數(shù)實現(xiàn)邊面轉90度的功能//bt為要轉的邊面voidborderturn(intbt){intx1,x2;x1=color[bt][0];x2=color[bt][1];color[bt][0]=color[bt][2];color[bt][1]=color[bt][3];color[bt][2]=color[bt][4];color[bt][3]=color[bt][5];color[bt][4]=color[bt]

8、[6];color[bt][5]=co

當前文檔最多預覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當前文檔最多預覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學公式或PPT動畫的文件,查看預覽時可能會顯示錯亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權歸屬用戶,天天文庫負責整理代發(fā)布。如果您對本文檔版權有爭議請及時聯(lián)系客服。
3. 下載前請仔細閱讀文檔內容,確認文檔內容符合您的需求后進行下載,若出現(xiàn)內容與標題不符可向本站投訴處理。
4. 下載文檔時可能由于網(wǎng)絡波動等原因無法下載或下載錯誤,付費完成后未能成功下載的用戶請聯(lián)系客服處理。