摘要: (文字描述太繁琐了, 贪吃蛇算法很经典不多说, 那个伪播放器,不值一提。)源码: 网页版贪吃蛇【http://files.cnblogs.com/crystalplus/%E4%B8%A4%E4%B8%AA%E7%BD%91%E9%A1%B5%E6%A0%B7%E4%BE%8B(%E6%97%A0%E9%9F%B3%E4%B9%90%E7%89%88).7z】显示截图://file : mian.css body { margin:0px; margin-top:20px; padding: 0px; background-color: gray; ... 阅读全文
posted @ 2011-11-26 11:55 Thomas Hwang 阅读(1049) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<map>typedef std::map<std::pair<int,int>,int>Dict;typedefDict::const_iterator It;int main(){ Dict d; d[std::make_pair(0,0)]=0; d[std::make_pair(1,2)]=1; d[std::make_pair(2,1)]=2; d[std::make_pair(2,3)]=3; d[std::make_pair(3,2)]=4; for(It it(d.begin() 阅读全文
posted @ 2011-11-21 19:31 Thomas Hwang 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 偶然在programmers.stackexchange.com上看到了这个有趣的问题,有人问:既然普遍认为编程是比较难的工作,为什么业务分析人员和项目经理们会拿比程序员更多的薪水?虽然大多数的时候程序员都被发现是最晚离开公司的人,可那些家伙的工作却能拿更多的报酬,为什么会这样?回答的人很多,但似乎只有一个是比较合情合理的,它是从经济学原理的角度分析的这个问题。人们所能获得的报酬往往会低于老板们的... 阅读全文
posted @ 2011-11-21 13:22 Thomas Hwang 阅读(109) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;templateclass BinaryTree{struct Node { T data; Node* lChildptr; Node* rChildptr; Node(T dataNew) { data = dataNew; lCh... 阅读全文
posted @ 2011-11-19 14:09 Thomas Hwang 阅读(180) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #pragma comment(lib, "glu32.lib")#pragma comment(lib, "opengl32.lib")struct GLRGB{GLfloat r,g,b;};void init() {glClearColor(1.0f, 0.0f, 1.0f, 1.0f);glEna... 阅读全文
posted @ 2011-11-12 19:49 Thomas Hwang 阅读(260) 评论(0) 推荐(0) 编辑
摘要: For example this code (executeon Ideone)#include #include int main() { for (int seed = 0; seed < 4; seed++ ) { printf( "Seed %d:", seed); srand( seed ); for(int i = 0; i < 5; i... 阅读全文
posted @ 2011-11-08 21:53 Thomas Hwang 阅读(169) 评论(0) 推荐(0) 编辑
摘要: gnome sort:def gnomeSort(unsort): i = 0 while i 1 : lft = mergesort(lft) if len(rgt)> 1 : rgt = mergesort(rgt) res =[] while lftand rgt: if lft[0] >= rgt[0]: res.append(... 阅读全文
posted @ 2011-11-04 17:32 Thomas Hwang 阅读(233) 评论(0) 推荐(0) 编辑
摘要: What does const at top level qualifier mean in C++? and what areother levels?For example:int const *i;int *const i;int const *const i;//////////////////////////////////////////////////////////////////... 阅读全文
posted @ 2011-11-03 22:21 Thomas Hwang 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Parameters Semantics on CIn C, everything is passed by value. "primitives" and "PODs" arepassed by copying their value. Modify them in your function, andthe original won't be modified. Still, the cost... 阅读全文
posted @ 2011-11-02 22:00 Thomas Hwang 阅读(118) 评论(0) 推荐(0) 编辑
摘要: mimetic is a free, MIT licensed,Email library (MIME) written in C++ designed to beeasy to use and integrate but yet fast and efficient.http://www.codesink.org/mimetic_mime_library.htmlGMP is a free li... 阅读全文
posted @ 2011-11-01 13:19 Thomas Hwang 阅读(194) 评论(0) 推荐(0) 编辑