This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ^{:doc | |
"Bejewelled Blitz (Facebook) player | |
Clojure program to play Bejewelled Blitz on Facebook | |
Work in progress | |
Only works with game on primary monitor | |
First you need to determine where the game board is on the screen | |
then set the :x and :y values in the game-loc def appropriately | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn rgb-distance-squared | |
"Euclidean distance squared between two rgb values" | |
[[r1 g1 b1] [r2 g2 b2]] | |
(let [r (- r1 r2) | |
g (- g1 g2) | |
b (- b1 b2)] | |
(+ | |
(* r r) | |
(* g g) | |
(* b b)))) |