Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn show-board [board]
- "Prints the board on the screen.
- Board must be a list of three lists of three elements with
- :cross for a cross and :circle for a circle, other value for nothing"
- (let [
- convert-elem {:cross \X, :circle \O}
- convert-line (fn [elems-line]
- (reduce str (map #(convert-elem % \_) elems-line)))
- ]
- (doseq [line board]
- (println (convert-line line)))))
- (show-board [[:cross :circle :a] [:none :circle :none] [:cross :none :none]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement