GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — 4clojure-golf/073_Analyze a Tic-Tac-Toe Board.clj at master · tmeits/4clojure-golf Expand file tree/ Copy path073_Analyze a Tic-Tac-Toe Board.cljMore file actions 19 lines (15 loc) · 472 Bytes / Copy path073_Analyze a Tic-Tac-Toe Board.cljFile metadata and controls19 lines (15 loc) · 472 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ;;; inspired by https://gist.github.com/1024984 (fn [a x b] (#{:o :x} (ffirst (filter #(a = %) `(~@b ~@(a map list b) ~(x b [0 1 2]) ~(x b [2 1 0])))))) apply #(map get % %2) ;;; This code fails in some cases. ;;; ref. https://twitter.com/#!/alanmalloy/status/80680005360828416 ;;; correct version ; (fn [a x b] ; (ffirst ; (remove #(or (some #{:e} %) (a not= %)) ; `(~@b ~@(a map list b) ~(x b [0 1 2]) ~(x b [2 1 0]))))) ;apply #(map get % %2) |
| You are visitor 01402894 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |