Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (set-sod-array! target-board offset line)
- (let loop ((line line) (target-board target-board) (count offset))
- (if (not (null? line))
- (begin
- (vector-set! target-board count
- (if (eq? #\space (car line))
- 0
- (car line)))
- (loop (cdr line) target-board (+ count 1)))
- count)))
- (define (read-sod-file path)
- (let ((file (open-input-file path))
- (board (make-vector 81)))
- (let read-while ((file file) (count 0))
- (let ((line (read-line file)))
- (if (not (eof-object? line))
- (read-while file (set-sod-array! board count (string->list line)))
- (close-input-port file))))
- board))
- (define (foo target-board)
- (display target-board))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement