Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (isolated )
- (define in (open-input-file "matrix.txt"))
- (define (iter i Nstr)
- (define line (read-line in))
- (if (equal? line eof) i
- (iter (+(help (string->list line) Nstr 1) i) (+ 1 Nstr) )))
- (iter 0 1))
- (define (help lst Nstr i)
- (cond
- ( (equal? (car lst) #\return ) 1)
- ( (equal? Nstr i) (help (cdr lst) Nstr (+ i 1)))
- ( (equal? (car lst) #\1) 0)
- ( (equal? (car lst) #\space) (help (cdr lst) Nstr i))
- (else (help (cdr lst) Nstr (+ i 1)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement