Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

show percentage instead

  • Loading branch information...
commit aaef95c61764e24e2898f69f674bfa7a349543c5 1 parent 29e85a2
@pepijndevos pepijndevos authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/clojure_quiz/core.clj
View
4 src/clojure_quiz/core.clj
@@ -44,13 +44,13 @@
(do
(println "Correct!")
(let [right (inc right)]
- (println "Right:" right ", Wrong:" wrong ", Ratio:" (if (pos? wrong) (/ right wrong) "-"))
+ (println "Right:" right ", Wrong:" wrong ", Percentage:" (int (* 100 (/ right (+ right wrong)))))
(recur right wrong questioner)))
(do
(println "Wrong!")
(println "Was:" correct)
(let [wrong (inc wrong)]
- (println "Right:" right ", Wrong:" wrong ", Ratio:" (if (pos? wrong) (/ right wrong) "-"))
+ (println "Right:" right ", Wrong:" wrong ", Percentage:" (int (* 100 (/ right (+ right wrong)))))
(recur right wrong questioner))))))
(def doc-quiz (partial quiz 0 0 choose-doc))
Please sign in to comment.
Something went wrong with that request. Please try again.