November 21, 2016

Daily programmer (easy Monday)

Another easy Monday except this one is little bit more easy than last one. Here is the task. I finished rather fast with initial version, but doing little changes for of times I’ve ended up with this. (ns daily-programmer.20161121_easy.core (:use [clojure.string :only [split-lines]])) (def wire-rules-m {"white" {:to-cut #{} :not-to-cut #{"white" "black"}} "red" {:to-cut #{"green"} :not-to-cut #{}} "black" {:to-cut #{} :not-to-cut #{"white" "green" "orange"}} "orange" {:to-cut #{"red" "black"} :not-to-cut #{}} "green" {:to-cut #{"orange" "white"} :not-to-cut #{}} "purple" {:to-cut #{} :not-to-cut #{"purple" "green" "orange" "white"}}}) (defn can-cut? ... Read more

November 17, 2016

Daily programmer (easy Monday)

Since this is first post on daily-programmer topic I need some introduction. So there is this awesome sub reddit called DailyProgrammer where programming tasks on algorithms are posted 3 times a week. Easy ones on Mondays, intermedium ones on Tuesdays and hard ones on Friday. You can post Your solutions in favorite language and compile and test them directly in the comment section with /u/CompileBot. I’ve been aware about this thing for already quite some time but never was able to stick with it for too long. ... Read more

© Andrii Ursulenko 2016