正在加载图片...
附录5:七巧板程序 DECLARE DYNCREATE( CMyDoc CChip m chipList [CHIP COUNT public void Reset o virtual void Delete Contents virtual void Serialize( CArchive& ar IMPLEMENT DYNCREATE(CMy Doc, CDocument /初始化拼图块 void CMyDoc:: Reseto pOiNt pointList [MAX POINTS pointList [o]. x=DELTA pointList[o]y DEltA pointList[1]. x=DELTA+CHIP WIDTH pointList[l] y DELTA pointList[2]. x= DELTA+CHIP WIDTH/2 pointList [2] y DELTA+CHIP WIDTH/2 m chipList [o]. SetChip(1, pointList, 3) pointList[o]. x =DELTA pointlist[o]. y =DELTA pointList[l].x= DELTA pointList[l]y DELTA+CHIP WIDTH pointList[2]. x= DELTA+CHIP WIDTH/2 pointList [2]y DELTA+CHIP WIDTH/2 m chipList[1]. SetChip(2, pointList, 3); pointList[o]. x= DELTA+CHIP WIDTH pointList[o]y= DELTA pointList[l].x= DELTA+CHIP WIDTH pointList[l] y= DELTA+CHIP WIDTH/2 pointList[2]. x= DELTA+(CHIP WIDTH*3)/4 pointList [2]y DELTA+CHIP WIDTH/4附录 5:七巧板程序 376 DECLARE_DYNCREATE(CMyDoc) CChip m_chipList[CHIP_COUNT]; public: voidReset(); virtual void DeleteContents(); virtual void Serialize(CArchive& ar); }; IMPLEMENT_DYNCREATE(CMyDoc, CDocument) // 初始化拼图块 void CMyDoc::Reset() { POINT pointList[MAX_POINTS]; pointList[0].x = DELTA; pointList[0].y = DELTA; pointList[1].x = DELTA+CHIP_WIDTH; pointList[1].y = DELTA; pointList[2].x = DELTA+CHIP_WIDTH/2; pointList[2].y = DELTA+CHIP_WIDTH/2; m_chipList[0].SetChip(1, pointList, 3); pointList[0].x = DELTA; pointList[0].y = DELTA; pointList[1].x = DELTA; pointList[1].y = DELTA+CHIP_WIDTH; pointList[2].x = DELTA+CHIP_WIDTH/2; pointList[2].y = DELTA+CHIP_WIDTH/2; m_chipList[1].SetChip(2, pointList, 3); pointList[0].x = DELTA+CHIP_WIDTH; pointList[0].y = DELTA; pointList[1].x = DELTA+CHIP_WIDTH; pointList[1].y = DELTA+CHIP_WIDTH/2; pointList[2].x = DELTA+(CHIP_WIDTH*3)/4; pointList[2].y = DELTA+CHIP_WIDTH/4;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有