2013年11月25日
摘要: 1。解释playprev函数的功能(1)把gm的子去除后转移gm的mark到之前的棋子并设置之前棋子为重画(2)如果当前棋子有吃掉,需要把吃掉的都重画(3)对吃掉的棋子采用迭代器,遍历数字设置nokilled和setstorn(4)重画public void playPrev(GoMove gm) { int i = gm.Point.X; int j = gm.Point.Y; Grid[i,j].removeStone(); m_gmLastMove = gameTree.peekPrev(... 阅读全文
posted @ 2013-11-25 08:05 wwtbuaa 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 不得不说真是没有意义的一次作业,lambda在C++里用的真是物超所值啊,智能指针用于实现这么大的功能也一点都不大材小用。智能指针的代码和运行结果#include#include#include#includeusing namespace std;int result(int n){ shared_ptr s(new char[13]); strcpy(s.get(),"Hello World!"); string s1(s.get()+12-n); *(s.get()+12-n)='\0'; string s2(s.get()); cout#includ 阅读全文
posted @ 2013-11-25 00:07 wwtbuaa 阅读(126) 评论(0) 推荐(0) 编辑