Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; I know it's not the most efficient of codes but...
- ; n is the fixed side-length
- ; m is the current count
- ; maps out both top and bottom of the square
- (define (sides n m pic1)
- (if (= m 1)
- (side n pic1)
- (side n (stack-frac (/ 1 n) (side n pic1) (middles n (- m 1) pic1 blank-bb)))))
- ; maps out all non-top/bottom lines
- (define (middles n m pic1 pic2)
- (if (> m 1)
- (stack-frac (/ 1 m) (middle n pic1 blank-bb) (middles n (- m 1) pic1 pic2))
- (sides n 1 pic1)))
- ; maps out single line on top/bottom
- (define (side n pic1)
- (quarter-turn-left(stackn n (quarter-turn-right pic1))))
- ; maps out single line on non-top/bottom
- (define (middle n pic1 pic2)
- (quarter-turn-left (stack-frac (/ 1 n) (quarter-turn-right pic1) (empty n (- n 1) pic1 pic2))))
- ; maps out blank space in single non-top/bottom line
- (define (empty n m pic1 pic2)
- (if (= m 1)
- (quarter-turn-right pic1)
- (stack-frac (/ 1 m) pic2 (empty n (- m 1) pic1 pic2))))
- ; from persian input
- (define (persian-hole pic n)
- (sides n n pic))
- (show (persian-hole (make-cross rcross-bb) 5))
Advertisement
Add Comment
Please, Sign In to add comment