This file contains hidden or 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 hidden or 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 hidden or 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 three.demo | |
(:require [THREE :as THREE])) | |
(def camera | |
(THREE/PerspectiveCamera. | |
75 | |
(/ 800 600) | |
1 | |
10000)) |
From https://en.wikipedia.org/wiki/Zebra_Puzzle
- There are five houses.
- The Englishman lives in the red house.
- The Spaniard owns the dog.
- Coffee is drunk in the green house.
- The Ukrainian drinks tea.
- The green house is immediately to the right of the ivory house.
- The Old Gold smoker owns snails.
- Kools are smoked in the yellow house.
This file contains hidden or 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 hidden or 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 maze.core | |
(:use [enchilada :only [canvas ctx value-of canvas-size]] | |
[monet.canvas :only [get-context stroke stroke-style stroke-cap begin-path close-path line-to move-to stroke-width]] | |
[monet.core :only [animation-frame]] | |
[jayq.core :only [$ document-ready data attr hide show]] | |
[maze.util :only [coord->pos]] | |
[maze.generator :only [create-maze]] | |
[maze.solver :only [solve]])) | |
(defn draw-path-segments [ctx snake start end] |
This file contains hidden or 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 hidden or 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 hidden or 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]))) |