This file contains 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 newtons-method.core) | |
(defn square [x] | |
(* x x)) | |
(defn good-enough? [guess x] | |
(< (Math/abs (- (square guess) x)) 0.001)) | |
(defn average [x y] | |
(/ (+ x y) 2)) |
This file contains 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 blackjack-helper.core | |
(:require [clojure.string :as str] | |
[clojure.set :as set]) | |
(:gen-class)) | |
(def H "HIT") | |
(def D "DOUBLE if allowed, otherwise HIT") | |
(def DS "DOUBLE if allowed, otherwise STAND") | |
(def S "STAND") | |
(def SP "SPLIT") |