Skip to content

Instantly share code, notes, and snippets.

View nmccarty-school's full-sized avatar

Nathan McCarty nmccarty-school

View GitHub Profile
(ns sudoku-solver.core
(:use [clojure.repl]
[clojure.set :as set]
[clojure.pprint]))
(def example-board
[[0 0 3 0 2 0 6 0 0]
[9 0 0 3 0 5 0 0 1]
[0 0 1 8 0 6 4 0 0]
@nmccarty-school
nmccarty-school / sudoku.txt
Last active May 31, 2017 04:15
Sudoku solver
(ns Sudoko-Solver.core
(:use [clojure.repl :as repl]
[clojure.set :as set]
[clojure.pprint]))
(defn check-coll [coll]
(= (set coll)
#{1 2 3 4 5 6 7 8 9}))
(defn not-zero? [num]
@nmccarty-school
nmccarty-school / forstudents.rkt
Last active December 23, 2015 02:29
Boilerplate along with completed example that will be used to introduce students to Racket by making conway's game of life.
#lang racket
(require racket/class
racket/gui/base)
;; Utility function, Did my best to explain what it does and how it does it in the comments
;; Do not touch this until you have constructed an meaningful interpretive dance explaining
;; tail recursion and functional hash sets
(define (count-freqs lst)
;; Given a list, returns an alist containing each distinct element paired with the number of occurances
(let counter ([hash-count (hash)] ;; Named let, because loops are for sissies