{{ message }}

Instantly share code, notes, and snippets.

Igorigorw

Last active Aug 29, 2015
bf

bf

A Clojure library designed to ... well, that part is up to you.

Usage

``````\$ lein run ">++++++++[<+++++++++>-]<.>>+>+>++>[-]+<[>[->+<<++++>]<<]>.+++++++..+++.>>+++++++.<<<[[-]<[-]>]<+++++++++++++++.>>.+++.------.--------.>>+.>++++."
Hello World!
``````

Created Jan 10, 2015
View fannkuch.clj
 (ns fannkuch.core (:require [clojure.math.combinatorics :as combo])) ; Fannkuchen ; ; it's super slow though ; also I was too stupid to implement permutations, so I used Mark Engelberg's library ; ; https://www.haskell.org/haskellwiki/Shootout/Fannkuch
Created Jan 9, 2015
View divmod.s.diff
 --- divmod2.s 2015-01-09 21:58:10.000000000 +0100 +++ divmod.s 2015-01-09 21:56:08.000000000 +0100 @@ -12,20 +12,27 @@ movq %rsp, %rbp Ltmp4: .cfi_def_cfa_register %rbp - leaq _divmod.n(%rip), %rax movl %edi, -4(%rbp) movl %esi, -8(%rbp) - movl -4(%rbp), %esi
Created Jan 9, 2015
View divmod.clj
 (ns divmod.core) ; division by repeated subtraction ; http://en.wikipedia.org/wiki/Division_algorithm#Division_by_repeated_subtraction (defn divmod [n d] (cond (= d 0) (throw (Throwable. "Division By Zero")) (< d 0)
Created Jan 7, 2015
GEB MU puzzle in miniKanren
View mu.scm
 ; Douglas Hofstadter's MU puzzle from Gödel, Escher, Bach ; written in miniKanren ; ; https://github.com/miniKanren/miniKanren/blob/master/mk.scm (load "mk.scm") (define print (lambda (exp) (display exp)
Created Jan 4, 2015
Last active Aug 29, 2015
View interp.clj
 (ns interp.core) (def empty-state {:ip 0, :code [], :stack '(), :labels {}}) (defn step [state] (let [instr (get (:code state) (:ip state)) state (update-in state [:ip] inc)] (cond (nil? instr)
Last active Feb 5, 2020
View avl-tree.php

Created Dec 28, 2014
miniKanren implementation of Lewis Carroll's "Fox, Goose, and Bag of Corn" puzzle, described by Carin Meier (@gigasquid)
View fox-goose-bag-of-corn.scm
 ; miniKanren solution to fox-goose-bag-of-corn ; https://github.com/gigasquid/wonderland-clojure-katas/blob/master/fox-goose-bag-of-corn/README.md (load "mk.scm") (define print (lambda (exp) (display exp) (newline)))
Last active Aug 29, 2015