Guest User

Untitled

a guest
May 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. (defn solution []
  2. (let [img (javax.imageio.ImageIO/read (io/file "/Users/gerasimov_a/projects/nano-solver/100px-Greek_lc_lamda_thin.svg.png"))
  3. width (.getWidth img)
  4. height (.getHeight img)
  5. grid (map (fn [row] (map (fn [col] (if (= 0 (.getRGB img col row)) 0 1)) (range width))) (range height))]
  6. (print (map #(str (apply str %) "\n") grid))))
  7.  
  8.  
  9. (11001000100000000000
  10. 10111111010000000000
  11. 01111111101000000000
  12. 01111111100100000000
  13. 11100001110100000000
  14. 11011101110010000000
  15. 00100010111010000000
  16. 11000110111011000000
  17. 00000101111101000000
  18. 00001011111101000000
  19. 00010011111101100000
  20. 00110111111110100000
  21. 00101111101110100001
  22. 01011111001110110010
  23. 10111111010111011101
  24. 00111110110111000011
  25. 01111101110011111111
  26. 11111001001011111111
  27. 11111010000101111110
  28. 10000100000010001000
  29. )
Add Comment
Please, Sign In to add comment