clean up read_line
This commit is contained in:
parent
91f76e6b22
commit
d8298d1a2a
|
@ -45,16 +45,13 @@
|
||||||
(if (<= e2 dx)
|
(if (<= e2 dx)
|
||||||
dx
|
dx
|
||||||
0))))))))))))))])
|
0))))))))))))))])
|
||||||
(read_line_2 . [(def read_line_2 (fn (keyboard stream)
|
|
||||||
((fn (c)
|
|
||||||
(if (= c 10)
|
|
||||||
stream
|
|
||||||
(if (= c 0)
|
|
||||||
stream
|
|
||||||
(read_line_2 keyboard (write stream c)))))
|
|
||||||
(key keyboard))))])
|
|
||||||
(read_line . [(def read_line (fn (keyboard)
|
(read_line . [(def read_line (fn (keyboard)
|
||||||
(read_line_2 keyboard (stream))))])
|
(let str (stream)
|
||||||
|
(let c (key keyboard)
|
||||||
|
(while (not (or (= c 0) (= c 10)))
|
||||||
|
(write str c)
|
||||||
|
(set c (key keyboard))))
|
||||||
|
str)))])
|
||||||
(chessboard . [(def chessboard (fn (screen px)
|
(chessboard . [(def chessboard (fn (screen px)
|
||||||
(chessboard1 screen px 0 15)))])
|
(chessboard1 screen px 0 15)))])
|
||||||
(chessboard1 . [(def chessboard1 (fn (screen px y color)
|
(chessboard1 . [(def chessboard1 (fn (screen px y color)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user