about summary refs log tree commit diff stats
path: root/html/shell/parse.mu.html
Commit message (Collapse)AuthorAgeFilesLines
* .Kartik Agaram2021-10-091-7/+7
|
* .Kartik Agaram2021-08-151-56/+56
|
* .Kartik K. Agaram2021-07-161-12/+12
|
* html: better highlighting for int registersKartik Agaram2021-06-261-49/+48
|
* .Kartik Agaram2021-06-261-9/+9
| | | | | Switch html rendering to my current colorscheme with a little less blue, for night browsing.
* .Kartik Agaram2021-06-241-3/+3
| | | | Switch html rendering to a white background.
* .Kartik Agaram2021-06-231-284/+290
|
* .Kartik Agaram2021-06-151-21/+21
|
* .Kartik Agaram2021-06-051-152/+167
|
* .Kartik Agaram2021-05-311-253/+264
|
* .Kartik Agaram2021-05-181-181/+229
|
* .Kartik Agaram2021-05-011-65/+76
|
* .Kartik Agaram2021-04-221-17/+17
|
* .Kartik Agaram2021-04-211-145/+223
|
* .Kartik Agaram2021-04-131-96/+110
|
* .Kartik Agaram2021-03-231-0/+198
="p">((already-lost? position me) #f) ((already-won? position me) #t) (else (not (find-one (lambda (pos) (not (one-okay-move pos me))) (extend position (opponent me)) ))))) (define (free-squares pos) (keep number? pos)) (define (number-squares pos) (ns-help pos 1)) (define (ns-help pos num) (cond ((empty? pos) "") ((equal? (first pos) '_) (word num (ns-help (bf pos) (+ num 1)))) (else (word (first pos) (ns-help (bf pos) (+ num 1)))) )) (define (plug-in letter sq pos) (cond ((empty? pos) "") ((= sq 1) (word letter (bf pos))) (else (word (first pos) (plug-in letter (- sq 1) (bf pos)))) )) (define (find-one pred stuff) (cond ((empty? stuff) #f) ((pred (first stuff)) (first stuff)) (else (find-one pred (bf stuff))) )) (define (extend pos who) (every (lambda (sq) (plug-in who sq pos)) (free-squares pos))) (define (opponent letter) (if (equal? letter 'x) 'o 'x)) (define (already-won? pos me) (find-one (lambda (win) (match-win? pos me win)) '(yyynnnnnn nnnyyynnn nnnnnnyyy ynnynnynn nynnynnyn nnynnynny ynnnynnny nnynynynn))) (define (already-lost? pos me) (already-won? pos (opponent me))) (define (match-win? pos me win) (cond ((empty? win) #t) ((equal? (first win) 'y) (if (equal? (first pos) me) (match-win? (bf pos) me (bf win)) #f)) (else (match-win? (bf pos) me (bf win))) ))