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 best-hand [hand] | |
(let [suit (fn [c] (first c)) | |
rank (fn [c] (last c)) | |
ranks [\2 \3 \4 \5 \6 \7 \8 \9 \T \J \Q \K \A] | |
four-of-a-kind? (fn [h] (if (some #(= 4 %) (vals (frequencies (map rank h)))) true false)) | |
flush? (fn [h] (= 1 (count (vals (frequencies (map suit h)))))) | |
straight? (fn [h] (let [indexed-ranks (sort (map #(.indexOf ranks %) (map rank h))) | |
ends-diff (- (first indexed-ranks) (last indexed-ranks))] | |
(cond | |
(and (= 5 (count (frequencies indexed-ranks))) |
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 gmaps-test.handler | |
(:use compojure.core) | |
(:require [compojure.handler :as handler] | |
[compojure.route :as route] | |
[hiccup.core :as h])) | |
(defn index-page [] | |
(h/html [:img {:src "http://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Ccolor:red%7Clabel:C%7C40.718217,-73.998284&sensor=false"}] | |
)) |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
body { | |
border-bottom-color: #ffd300; | |
border-bottom-width: 10px; | |
border-collapse: collapse; | |
border-left-color: #fcfa02; | |
border-right-color: #fcfa02; | |
border-style: groove; |