1.4.2.1 阅读函数式程序
我们在清单 1.1 中看过一个示例,就是使用了不可变类型,我们的结论是,不可变类型使代码更具可读性。在本节,我们将考虑两段代码,可以用在我们函数式游戏中。
清单 1.8 中有两个示例,都涉及两个游戏角色(player 和 monster)。第一个示例说明怪物[1]如何移动一步,然后,判断玩家是否正处于危险之中,第二示例演示如何射击。
Listing...
分类:
其他好文 时间:
2014-07-27 11:31:32
阅读次数:
226
--------------输出----------------print 'hello world'--以文本形式输出select 'hello world'--以网格形式输出,也可以设置成以文本形式输出print 'abc'+'cde'print 3+5print 'ab'+5--出错,'ab'...
分类:
其他好文 时间:
2014-07-27 10:42:52
阅读次数:
275
Flash Player调试器版本的解决办法Flash Builder 找不到所需的Adobe Flash Builder在Debug时出现的问题:Flash Builder 找不到所需的Adobe Flash Player调试器版本解决方法:1. 进入Flash Builder的安装目录 C:\P...
分类:
其他好文 时间:
2014-07-27 10:00:52
阅读次数:
508
Game PredictionSuppose there are M people, including you, playing a special card game. At the beginning, each player r...
分类:
其他好文 时间:
2014-07-27 09:44:42
阅读次数:
395
Problem Description
In the shooting game, the player can choose to stand in the position of [1, X] to shoot, you can shoot all the nearest K targets. The value of K may be different on different shoo...
分类:
其他好文 时间:
2014-07-26 15:08:00
阅读次数:
383
把程序打成jar包放到Linux上
转到目录下执行命令 hadoop jar mapreducer.jar /home/clq/export/java/count.jar hdfs://ubuntu:9000/out06/count/
上面一个是本地文件,一个是上传hdfs位置
成功后出现:打印出来,你所要打印的字符。
package com.clq.hdfs;
import java...
分类:
编程语言 时间:
2014-07-26 02:27:17
阅读次数:
270
原文:http://baoz.me/446252 码农周刊如何让 Python 代码运行得更快?作者给出了 18 条 Python 代码性能优化小贴士,简单明了,拿来即用。http://infiniteloop.in/blog/quick-python-performance-optimizatio...
分类:
编程语言 时间:
2014-07-26 01:44:36
阅读次数:
648
--判断库是否存在,存在则删除if exists (select name from master..sysdatabases where name in ('db_name'))drop database db_namego--判断存储过程是否存在,存在则删除if exists (select *...
分类:
数据库 时间:
2014-07-26 01:36:46
阅读次数:
259
本文转载自:http://quick.cocoachina.com/wiki/doku.php?id=ios%E7%89%88%E6%9C%AC%E4%BD%BF%E7%94%A8%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AD%97%E4%BD%93%E6%AD%A5%E9%AA...
分类:
移动开发 时间:
2014-07-26 00:57:26
阅读次数:
240
最近由于忙了一段时间,忙完了之后又迷茫了这么久,然后终于开始继续Quick-x的学习之路了。然后遇到了一个比较棘手的问题。虽然照着官方mvc的例子敲代码,但是还是不停的报错,报错的问题下次集结成一个帖子发出来好了。今次记录的是对于错误的DEUG方面的问题。我的首选当然是Eclipse + LDT了,...
分类:
其他好文 时间:
2014-07-26 00:09:26
阅读次数:
248