主角出场:
初始化主角
hero = new GameObjHero();
hero->setScale(0.5);
hero->setPosition(ccp(100,160));
hero->setVisible(false);
addChild(hero,1);
进入GameObjHero类ccp文件
创建主角及动作
this->setC...
分类:
其他好文 时间:
2014-06-05 08:51:31
阅读次数:
181
一切见注释。
#include
#include
#include
#include
using namespace std;
bool vis[22];
int n;
int ans[22];
int top;
bool isprime(int x)//判断素数
{
for(int i=2;i<x;i++)
if(x%i==0)return false;
...
分类:
其他好文 时间:
2014-06-05 08:26:47
阅读次数:
201
题目:输入两个字符串,从第一字符串中删除第二个字符串中所有的字符。例如,输入”They are students.”和”aeiou”,则删除之后的第一个字符串变成”Thy r stdnts.”。
这里主要要分析两个方面:
1、如何判断那些字符是需要删除的字符。同很多字符串问题一样,可以开辟一个哈希数组,全部初始化为false,将第二个字符串中字符对应的映射位置置为ture,表示这些位置对应的字符在第一个字符串中需要删除。
2、关于删除字符的操作,每次删除一个,而后把后面的元素均左移一...
分类:
其他好文 时间:
2014-06-05 01:47:12
阅读次数:
196
【题目】
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before imple...
分类:
其他好文 时间:
2014-06-04 23:45:09
阅读次数:
388
1、集合
当向集合Set中增加对象时,首先集合计算要增加对象的hashcode,根据该值得到一个位置用来存放当前的对象,当在该位置没有一个对象存在的时候,集合set认为该对象在集合中不存在,直接增加进去。如果在该位置有一个对象存在,接着将准备增加到集合中的的对象与该位置上的对象进行equals比较,若返回false,在进行一次散列,将该对象放到散列后计算出的新地址。若返回true,不会再将该对象增加到集合中
2、当重写equals方法时,必须要重写hashcode方法
如果一个类的两个对象,使用equa...
分类:
编程语言 时间:
2014-06-04 21:49:17
阅读次数:
313
public class TestRetry {
public static void main(String[] args) {
retry(5);
}
private static void retry(int maxCount) {
int count = 0;
boolean result = false;
do {
count++;
System....
分类:
其他好文 时间:
2014-06-03 05:10:35
阅读次数:
179
前言
欢迎大家我分享和推荐好用的代码段~~
声明
欢迎转载,但请保留文章原始出处:
CSDN:http://www.csdn.net
雨季o莫忧离:http://blog.csdn.net/luckkof
正文
private static Boolean isExit = false;
...
分类:
移动开发 时间:
2014-06-03 02:25:32
阅读次数:
257
$act=!empty($_GET['act']) ? trim($_GET['act']) : '';
switch($act) {
case 'adda':
$area['a_value'] = trim($_POST['a_value']);
$area['a_type']=3;
if(strpos($area['a_value'], "\n") === false) ...
分类:
Web程序 时间:
2014-06-03 00:46:17
阅读次数:
297
游戏主菜单页面
BeginLayer类封装该页面,init函数初始化该页面布景
该页面背景
isDialog = false;
setKeypadEnabled(true); //开启按键事件
CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint or...
分类:
其他好文 时间:
2014-06-02 23:10:45
阅读次数:
279
前提:有时候需要在网页上,加载另一个网站上的数据。或者加载另一个网站上的一个页面。Js的Ajax请求不具备跨域功能,可以使用JQuery来实现。网页端JS代码:$(function
() { $.ajax({ type: "get", async: false, ...
分类:
Web程序 时间:
2014-05-31 18:27:46
阅读次数:
210