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 clojure-conj-talk.core | |
(:use [enchilada :only [canvas ctx canvas-size]] | |
[monet.canvas :only [fill-style fill-rect]] | |
[jayq.core :only [show]]) | |
(:require [cljs.core.async :refer [<! >! chan timeout]]) | |
(:require-macros [cljs.core.async.macros :as m :refer [go]])) | |
(def colors | |
(rand-nth [ | |
[ |
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 async-test.sinewave.core | |
(:require [cljs.core.async :refer [<! >! chan timeout]]) | |
(:require-macros | |
[cljs.core.async.macros :as m :refer [go]])) | |
(defn sin-vals [offset] | |
(map #(Math/sin %) (iterate (partial + 0.1) offset))) | |
(let [events (chan)] |
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 boids | |
(:use [enchilada :only [canvas ctx value-of canvas-size]] | |
[jayq.core :only [show]] | |
[monet.core :only [animation-frame]] | |
[monet.canvas :only [save restore | |
begin-path move-to line-to close-path | |
stroke stroke-style fill fill-rect fill-style | |
rotate translate]] | |
[boids.rules :only [step make-boid]]) | |
(:require [boids.vector :refer [heading]])) |
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 recurring.example | |
(:require [enchilada])) | |
(loop [xs [[1 1 1] [2 2 2] [3 3 3]]] | |
(when-let [[a b c] (first xs)] | |
(println a b c) | |
(recur (rest xs)))) |
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
(println | |
(#(list % (list 'quote %)) '#(list % (list 'quote %)))) |
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 tests | |
(:refer-clojure :exclude [==]) | |
(:use-macros | |
[cljs.core.logic.macros | |
:only [run run* == conde conda condu fresh defne matche all]]) | |
(:require-macros [cljs.core.logic.macros :as m] | |
[clojure.tools.macro :as mu]) | |
(:use | |
[enchilada :only [ctx]] | |
[cljs.core.logic |
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 classic-ai-example | |
(:require-macros [cljs.core.logic.macros :as m]) | |
(:use [cljs.core.logic :only [-take*]])) | |
(m/defne moveo [before action after] | |
([[:middle :onbox :middle :hasnot] | |
:grasp | |
[:middle :onbox :middle :has]]) | |
([[pos :onfloor pos has] | |
:climb |
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 example | |
(:require-macros [cljs.core.logic.macros :as m]) | |
(:use [cljs.core.logic :only [membero]])) | |
(println | |
(m/run* [q] | |
(membero q '(:cat :dog :bird :bat :debra)))) |
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 sudoku | |
;(:refer-clojure :exclude [==]) | |
(:require-macros [cljs.core.logic.macros :as m]) | |
(:use [cljs.core.logic :only [everyg infd distinctfd]])) | |
(defn get-square [rows x y] | |
(for [x (range x (+ x 3)) | |
y (range y (+ y 3))] | |
(get-in rows [x y]))) |