refactoring (probably needed for previous days too, oops)
This commit is contained in:
@@ -1,15 +1,6 @@
|
||||
(import (srfi :43)) ; vector extensions
|
||||
(load "../common.scm")
|
||||
|
||||
; reads a numnber from input
|
||||
; also consumes the next non-number character in the file!
|
||||
(define (get-number file)
|
||||
(let loop [(n 0)]
|
||||
(let [(c (get-char file))]
|
||||
(if (char-numeric? c)
|
||||
[loop (+ (char->number c) (* n 10))]
|
||||
n))))
|
||||
|
||||
; reads pairs of coordinates
|
||||
; returns a list of the form (((x1 y1) (x2 y2))...)
|
||||
(define (read-lines file)
|
||||
|
||||
Reference in New Issue
Block a user