Skip to content

Instantly share code, notes, and snippets.

View orb's full-sized avatar

Norman Richards orb

View GitHub Profile
(defn can-sum-to-zero
([nums]
(can-zero nums #{}))
([nums can-sum-to]
(when (seq nums)
(let [num (first nums)]
(if (can-sum-to (- num))
true
(let [can-also-sum-to (map #(+ num %) can-sum-to)]
(recur (rest nums)
@orb
orb / sudoku.clj
Last active April 24, 2020 12:04 — forked from swannodette/gist:3217582
updated for the latest core.logic, with some minor tweaks for (I hope) clarity
(ns sudoku
(:refer-clojure :exclude [==])
(:use [clojure.core.logic])
(:require [clojure.core.logic.fd :as fd]))
(defn init-board [vars puzzle]
(matche [vars puzzle]
([[] []]
succeed)
<html>
<head>
<title>TEST</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
Bitcoin price is <b id="price">--</b>
<script>
$(function(){
$.get("https://data.mtgox.com/api/1/BTCUSD/ticker", function(data) {