0011 嘿嘿

-----

Economy is one powerful motive for camping, since after the initial outlay upon equipment, or through hiring it, the total expense can be far less than the cost of hotels.

But, contrary to a popular assumption, it is far from being the only one, or even the greatest.

The man who manoeuvres carelessly into his 20 pounds' worth of space at one of Europe's myriad permanent sites may find himself bumping a Bentley.

-----

因为我想大致熟悉一下用 common lisp 编程的感觉,M.Hiroi's Home 里面知识点比较散,觉得学习效果不是很好。

即使动了手,也仍然只是用原来的做法,用 lisp 的命令重新表述一遍。

再来写的是一个一个小东西,不是很有趣。

后来在书店看到了 Land of lisp 这本书,现在看了快一半,看到 loop 的这一章,感觉里面的例子写的很好。

而且一个一个的程序都感觉是有很多扩充空间的,并且用到了很多 lisp 的思维方式去做。

于是,决定先看这本书。

这里从后往前的记录一下觉得比较需要注意的地方。

Chapter 10

(parse-integer str :junk-allowed t)

(fresh-line)

(gethash (cons x y) *plants*)

(defparameter :child (copy-structure *parent*))

(remhash pos *plants*)

Periodic Table of the Loop Macro

collect

(defstruct animal x y energy dir genes)

(defparameter *plants* (make-hash-table :test #'equal))


Chapter 9

decf

(defstruct (brigand (:include monster)))

(push #'make-brigand *monster-builders*)


(defstruct (slime-mold (:include monster)) (sliminess (randval 5)))

(push #'make-slime-mold *monster-builders*)


(defstruct (orc (:include monster)) (club-level (randval 8)))

(push #'make-orc *monster-builders*)


(defstruct monster (health (randval 10)))

(defun monsters-dead () (every #'monster-dead *mmonsters*))

(defun monster-dead () (<= (monster-health m) 0))


(map 'vector (lambda ...) (make-array *monster-num*))


感觉,这样写了也没什么启示作用。从来就是考脑子记,不看笔记的。。。

俄。今天先到这里吧。





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值