Advertisement
PonaFly

Untitled

Apr 19th, 2019
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. (define (Sol4 matrix)
  2. (define (creating k vn matr rez)
  3.  
  4. (if (empty? matr) rez
  5. (if (empty? (car matr)) (creating (add1 k) 0 (cdr matr) rez)
  6. (if (= (length (car matr)) 1) (creating (add1 k) 0 (cdr matr) (if (= (caar matr) 1) (cons (cons k vn) rez) rez))
  7. (creating k (add1 vn) (my-cdar matr) (if (= (caar matr) 1) (cons (cons k vn) rez) rez)) ))))
  8.  
  9.  
  10. (creating 0 0 matrix (if (= (car (reverse (car (reverse matrix)))) 1) (cons (cons (- (length matrix) 1)(- (length matrix) 1)) '()) '())))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement