(ns enchilada.aspirational-vanity-product | |
(:require | |
[enchilada :refer [ctx canvas]] | |
[big-bang.core :refer [big-bang]] | |
[jayq.core :refer [show attr css]] | |
[monet.canvas :refer [begin-path move-to line-to clear-rect | |
stroke stroke-style stroke-width stroke-cap | |
save restore translate rotate]])) | |
(def two-pi (* 2 Math/PI)) |
(ns enchilada.color-vortex | |
(:require | |
[jayq.core :refer [show css]] | |
[enchilada :refer [ctx canvas canvas-size]] | |
[inkspot.color :refer [coerce red green blue]] | |
[inkspot.converter :refer [hsv->rgb]] | |
[big-bang.core :refer [big-bang]] | |
[big-bang.events.browser :refer [offset-coords]] | |
[monet.canvas :refer [stroke-style stroke fill-style fill fill-rect | |
ellipse save restore translate]])) |
(ns enchilada.slinky | |
(:require | |
[jayq.core :refer [show css]] | |
[enchilada :refer [ctx canvas canvas-size]] | |
[big-bang.core :refer [big-bang]] | |
[big-bang.events.browser :refer [offset-coords]] | |
[monet.canvas :refer [stroke-style stroke fill-style fill fill-rect arc begin-path close-path]])) | |
(def screen-area | |
(let [[w h] (canvas-size)] |
for
- Move the mouse horizontally to change threshold point
- Click the mouse to alter the resolution
- Press the 'C' key to cycle between [10-Print, Greyscale, Inverse, Solarize]
- Refresh the page for a different image (chosen at random)
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
(ns enchilada.rotating-spiral | |
(:require | |
[jayq.core :refer [show]] | |
[enchilada :refer [ctx canvas]] | |
[big-bang.core :refer [big-bang]] | |
[monet.canvas :refer [fill-style fill ellipse rotate translate save restore fill-rect]])) | |
(def initial-state { | |
:angle 0 | |
:radius 600 |
(ns corewar.gui | |
(:require | |
[clojure.string :as str] | |
[jayq.core :refer [show]] | |
[enchilada :refer [canvas ctx canvas-size]] | |
[corewar.memory :as mem] | |
[corewar.assembler :as asm] | |
[corewar.instruction-set :as instr] | |
[corewar.virtual-machine :as vm] | |
[corewar.redcode :as red] |