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) | |
;; Print output goes to the output buffer | |
(doseq [a (range 10) | |
b (range a)] | |
(println a "x" b "=" (* a b))) | |
(js/alert "ClojureScript says 'Boo!'") |
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
;; Draws a simple pentagon and other geometric stars using turtle graphics | |
;; | |
;; Scale it to fit in a bounding-box of 750x550 px | |
(ns turtle.demo | |
(:use [turtle.core :only [draw!]] | |
[turtle.renderer.canvas :only [->canvas]] | |
[jayq.core :only [show]] | |
[enchilada :only [ctx canvas]])) | |
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 transcendental-numbers.champernownes-constant | |
(:use [transcendental-numbers.utils :only [digits integers]])) | |
(def digit-seq | |
(mapcat digits integers)) |
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
;; Adapted from javascript version by Tristan Brehaut at | |
;; http://js1k.com/2013-spring/details/1362 | |
(ns flower-of-life.demo | |
(:use [monet.canvas :only [save restore begin-path end-path translate rotate | |
stroke stroke-style fill-style fill-rect move-to | |
bezier-curve-to composition-operation]] | |
[monet.core :only [animation-frame]] | |
[jayq.core :only [show]] | |
[enchilada :only [ctx canvas]])) |
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
;; Turmites | |
;; -------- | |
;; A simple N-state two-color Turing machine which operates on a wrapped | |
;; grid of black and white cells, and follows custom rules on every tick of | |
;; a clock. | |
;; | |
;; Predef rules derived from http://code.google.com/p/ruletablerepository/downloads/detail?name=Turmites.zip | |
;; | |
;; Copyright (c) Richard Hull 2012 | |
;; |
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 error.demo) | |
(+ 3 6 |
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
; chroma-spirals.cljs | |
; loosely based on some python code written by Peter Derlien, University of Sheffield, March 2013 | |
; Draws spiralling patterns of circles using the Golden Angle. | |
(ns chroma-spirals.demo | |
(:use [monet.canvas :only [fill-style fill-rect circle rotate translate composition-operation]] | |
[monet.core :only [animation-frame]] | |
[enchilada :only [ctx canvas]] | |
[chroma-spirals.color-chart :only [color-seq]] | |
[jayq.core :only [show]] |
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 lindenmayer-systems.demo | |
(:use [turtle.core :only [draw!]] | |
[turtle.renderer.canvas :only [->canvas]] | |
[enchilada :only [ctx canvas]] | |
[jayq.core :only [show]])) | |
(def dragon-seq | |
"Unfolding the dragon" | |
(letfn [(seq0 [x y] | |
(lazy-seq (cons (flatten x) (seq0 [x :right 90 y :fwd 20] [:fwd 20 x :left 90 y]))))] |
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 arnolds-cat-map.demo | |
(:use [monet.canvas :only [draw-image get-pixel composition-operation]] | |
[monet.core :only [animation-frame]] | |
[enchilada :only [ctx canvas proxy-request]] | |
[jayq.core :only [show]] | |
[jayq.util :only [wait]]) | |
(:use-macros [dommy.macros :only [sel1 node]])) | |
(def cat-resources | |
[ |
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 us-choropleth.demo | |
(:use-macros [c2.util :only [bind!]]) | |
(:use [jayq.core :only [show hide]] | |
[c2.core :only [unify]] | |
[c2.maths :only [extent floor]] | |
[c2.geo.core :only [geo->svg]] | |
[c2.geo.projection :only [albers-usa]] | |
[dataset.geo.us :only [states]] | |
[enchilada :only [canvas svg]]) | |
(:require [c2.scale :as scale] |
OlderNewer