diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-03-19 18:54:14 +0100 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2023-03-19 18:54:14 +0100 |
| commit | 32c08092b1a063caf2796baff9ba97ea6172db8a (patch) | |
| tree | 60fb4867cad883a9bb6abfd0e3f9a34a619f4e62 /coding-exercises/2/46.rkt | |
| parent | dc322c0c524ae959e623636d68716c91d5a09404 (diff) | |
49 sucked
Diffstat (limited to 'coding-exercises/2/46.rkt')
| -rw-r--r-- | coding-exercises/2/46.rkt | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/coding-exercises/2/46.rkt b/coding-exercises/2/46.rkt index 4016ef7..91fad04 100644 --- a/coding-exercises/2/46.rkt +++ b/coding-exercises/2/46.rkt @@ -1,27 +1,27 @@ #lang racket -(require "../../shared/lists.rkt") - -(define (make-vect x y) - (cons x y)) -(define (xcor-vect v) - (car v)) -(define (ycor-vect v) - (cdr v)) - -(define (add-vect . v) - (make-vect - (fold-right + 0 (map xcor-vect v)) - (fold-right + 0 (map ycor-vect v)))) -(define (sub-vect . v) - (let ((xcors (map xcor-vect v)) - (ycors (map ycor-vect v))) - (make-vect - (- (car xcors) (fold-right + 0 (cdr xcors))) - (- (car ycors) (fold-right + 0 (cdr ycors)))))) -(define (scale-vect s v) - (make-vect (* s (xcor-vect v)) - (* s (ycor-vect v)))) - +;; (require "../../shared/lists.rkt") +;; +;; (define (make-vect x y) +;; (cons x y)) +;; (define (xcor-vect v) +;; (car v)) +;; (define (ycor-vect v) +;; (cdr v)) +;; +;; (define (add-vect . v) +;; (make-vect +;; (fold-right + 0 (map xcor-vect v)) +;; (fold-right + 0 (map ycor-vect v)))) +;; (define (sub-vect . v) +;; (let ((xcors (map xcor-vect v)) +;; (ycors (map ycor-vect v))) +;; (make-vect +;; (- (car xcors) (fold-right + 0 (cdr xcors))) +;; (- (car ycors) (fold-right + 0 (cdr ycors)))))) +;; (define (scale-vect s v) +;; (make-vect (* s (xcor-vect v)) +;; (* s (ycor-vect v)))) +(require "../../shared/pict.rkt") (define test-vec (make-vect 1 2)) (define test-vec2 (make-vect 3 4)) ((lambda () |
