mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Old file
This commit is contained in:
parent
94df8603c6
commit
a274cfa6e1
1 changed files with 0 additions and 26 deletions
|
@ -1,26 +0,0 @@
|
|||
;;; MAZE -- Constructs a maze on a hexagonal grid, written by Olin Shivers.
|
||||
|
||||
(import (scheme base) (scheme read) (scheme write) (scheme time))
|
||||
|
||||
(define (get-set-root s)
|
||||
(let lp ((r s));; Find the last pair
|
||||
(let ((next (cdr r)));; in the list. That's
|
||||
(cond ((pair? next) (lp next));; the root r.
|
||||
|
||||
(else
|
||||
(if (not (eq? r s));; Now zip down the list again,
|
||||
(let lp ((x s));; changing everyone's cdr to r.
|
||||
(let ((next (cdr x)))
|
||||
(cond ((not (eq? r next))
|
||||
(set-cdr! x r)
|
||||
(lp next))))))
|
||||
r)))));; Then return r.
|
||||
|
||||
(write
|
||||
(get-set-root '(
|
||||
(a . 1)
|
||||
(b . 2)
|
||||
(c . 3)
|
||||
(d . 4)
|
||||
(e . 5)
|
||||
)))
|
Loading…
Add table
Reference in a new issue