mirror of
https://github.com/mx42/codingame.git
synced 2026-01-14 05:39:51 +01:00
Adding easy puzzles
This commit is contained in:
24
puzzles/easy/the-descent.clj
Normal file
24
puzzles/easy/the-descent.clj
Normal file
@@ -0,0 +1,24 @@
|
||||
;; https://www.codingame.com/ide/puzzle/the-descent
|
||||
;; Xavier Morel - 2016-03-12
|
||||
|
||||
(ns Player
|
||||
(:gen-class))
|
||||
; Auto-generated code below aims at helping you parse
|
||||
; the standard input according to the problem statement.
|
||||
|
||||
(defn -main [& args]
|
||||
(while true
|
||||
(def maxValue 0)
|
||||
(def maxRange 0)
|
||||
(loop [i 8]
|
||||
(when (> i 0)
|
||||
(let [mountainH (read)]
|
||||
(when (> mountainH maxValue)
|
||||
(def maxValue mountainH)
|
||||
(def maxRange (- 8 i))
|
||||
)
|
||||
(recur (dec i)))))
|
||||
; (binding [*out* *err*]
|
||||
; (println "Debug messages..."))
|
||||
; The number of the mountain to fire on.
|
||||
(println maxRange)))
|
||||
Reference in New Issue
Block a user