small medium large xlarge

17 Jul 2015, 13:59
Arthur Cousseau (1 post)

Hi, I just don’t understand why I’m getting an error with this :

(defn -main [& args] (let [LX (read) LY (read) initialTX (read) initialTY (read)] (def TX (- LX initialTX)) (def TY (- LY initialTY)) (while true (if (> TY 0) ((print "S") (dec TY)) (if (< TY 0) ((print "N") (inc TY)))) (if (> TX 0) ((print "E") (dec TX)) (if (< TX 0) ((print "W") (inc TX)))) (do (println "")) ) ) )

This gives me a pretty “Exception in thread “main” java.lang.NullPointerException”

Can you help me with this ? Thanks in advance ! :)

P.S : I didn’t find out how to post my code properly indented.