原创 功能異常簡單的貪喫蛇(隊列實現)

#include<stdio.h> #include<stdlib.h> #include<time.h> #include<windows.h> #define u 0 #define r 1 #define l 2 #defi

原创 huffman編碼樹

;leaf (define (make-leaf symbol weight) (list 'leaf symbol weight)) (define (symbol-leaf leaf) (cadr leaf)) (de

原创 church計數

正如書中寫的一樣(“還不足以令人如雷灌頂是吧?!!”),看到完全沒有數實現加一和0的定義,着實嚇了一跳。 當然了,既然你不走尋常路,那我也不能在一棵樹上吊死,你說不用數字,那至少得體現數的概念吧?多少個蘋果是數,函數迭代多少次也

原创 嵌套映射

本小節代碼需要和”序列操作”那節的代碼在一起運行 ;仿照了二重循環的方式 (define (make-pairs1 n) (define (i-iter i ans) (define (j-iter j ansi)

原创 表格的表示

;一維表格 (define (make-table) (list '*table*)) (define (assoc key records) (cond ((null? records) #f) ((eq

原创 emacs配置

最近在學sicp,試了DrRacket雖然有一些功能非常有吸引力(比如方便的調試功能,代碼結構的分析),但是爲了更好的編輯還是選擇了emacs(傳說中神一樣的編輯器),於是折騰了好幾天emacs,總算摸到了一點一點風。。。 先推

原创 數字電路的模擬

;基本功能塊 ;延時: (define inverter-delay 2) (define and-gate-delay 3) (define or-gate-delay 5) ;inverter (define (inverte

原创 序列操作

看完這一節,感覺世界觀又被重塑。 首先說說這一小節的標題”序列作爲一種約定的界面”是什麼意思:這句話意思是序列作爲程序不同模塊間數據流動的形式。 學習lisp語言不久,lisp就給了我很多驚喜,我特地新建了一個文件夾叫asto

原创 B樹相關操作

花了一個下午把書上的B樹操作看明白了,又花了一天把代碼憋出來…主要是操作比較複雜,需要注意的細節太多…至於刪除操作,書上已經詳細說明了過程…累啊 有一個不確定的地方是,不清楚如果重複數據有或者比較多的情況會怎麼樣 輸入樣例 21

原创 共享和相等

參考這裏 ;3.16 (define (count-pairs x) (if (not (pair? x)) 0 (+ (count-pairs (car x)) (count-pai

原创 集合作爲排序的表

(define (element-of-set? x set) (cond ((or (null? set) (> (car set) x)) #f) ((= x (car set)) #t)

原创 p549擴展歐幾里得

#include<stdio.h> int euclid(int a,int b,int *x,int *y) { if (b==0) { *x=1; *y=0; r

原创 功能異常簡單的貪吃蛇(隊列實現)

#include<stdio.h> #include<stdlib.h> #include<time.h> #include<windows.h> #define u 0 #define r 1 #define l 2 #defi

原创 bufbomb-緩衝區溢出實驗

實驗目的 本實驗的目的在於加深對IA-32函數調用規則和棧結構的具體理解。實驗的主要內容是對一個可執行程序”bufbomb”實施一系列緩衝區溢出攻擊(buffer overflow attacks),也就是設法通過造成緩衝區溢出來

原创 層次性結構

(define (append a b) (if (null? a) b (cons (car a) (append (cdr a) (cons (car a) b))))) (define nil (