Skip to content

Instantly share code, notes, and snippets.

View Raynes's full-sized avatar

Anthony Grimes Raynes

View GitHub Profile
(ns main.main)
(defn main [] (println "Hello, World!"))
(ns main.main)
(defn main
([name] (println (str "Hi there, " name)))
([] (main "World!")))
(require 'swank.swank)
(swank.swank/ignore-protocol-version "2009-05-17")
(swank.swank/start-server "/tmp/slime.17534" :encoding "iso-latin-1-unix")
Clojure 1.1.0-alpha-SNAPSHOT
user=> java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V (pprint.clj:1)
user=> user=> java.lang.Exception: No such var: swank.swank/ignore-protocol-version (NO_SOURCE_FILE:3)
user=> user=> java.lang.Exception: No such var: swank.swank/start-server (NO_SOURCE_FILE:5)
(ns cipher)
(def alphabet-nums (apply hash-map (interleave (range 1 27) "abcdefghijklmnopqrstuvwxyz")))
(def alphabet-chars (apply hash-map (interleave "abcdefghijklmnopqrstuvwxyz" (range 1 27))))
(defn is-letter? [s]
(if (re-find #"(?i)[a-z]" (.toString s)) true false))
(defn shift-char
"Shifts the given Character down the alphabet by three."
(ns cipher
(:use [clojure.contrib.def :only (defnk)]))
(def alphabet-nums (apply hash-map (interleave (range 1 27) "abcdefghijklmnopqrstuvwxyz")))
(def alphabet-chars (apply hash-map (interleave "abcdefghijklmnopqrstuvwxyz" (range 1 27))))
(defn is-letter? [s]
(if (re-find #"(?i)[a-z]" (.toString s)) true false))
(defn shift-char-forward
(ns cipher
(:use [clojure.contrib.def :only (defnk)]))
(def alphabet-nums (apply hash-map (interleave (range 1 27) "abcdefghijklmnopqrstuvwxyz")))
(def alphabet-chars (apply hash-map (interleave "abcdefghijklmnopqrstuvwxyz" (range 1 27))))
(defn is-letter? [s]
(if (re-find #"(?i)[a-z]" (.toString s)) true false))
(defnk shift-char-forward
; SLIME 20091016
user> (shift-char-forward \a)
; Evaluation aborted.
user> (shift-char-forward 1)
; Evaluation aborted.
user> (shift-char-forward 1)
; Evaluation aborted.
user> (shift-char-forward 1)
; Evaluation aborted.
user> (ns cipher)
(ns cipher
(:use [clojure.contrib.def :only (defnk)]))
(def alphabet-nums (apply hash-map (interleave (range 1 27) "abcdefghijklmnopqrstuvwxyz")))
(def alphabet-chars (apply hash-map (interleave "abcdefghijklmnopqrstuvwxyz" (range 1 27))))
(defn is-letter? [s]
(if (re-find #"(?i)[a-z]" (.toString s)) true false))
(defnk shift-char
QUOTE
QUOTE
QUOTE
Dude, I have nothing against you personally. From what I have read you seem nice enough. I have known some witches and pagans in my day, and have called some friend. Don't feel a need to take what I say personally. smile.gif
You haven't said anything against me personally. I don't have anything against you whatsoever. There are just certain things that bother me. I honestly didn't mean to offend you, if I did.
Takes a lot to offend me bro. I am a soldier, at the front lines of this war. This is what I do. I just wanted to make sure you didn't take it hard. smile.gif were cool.
public string Encrypt(string word)
{
word.ToLower();
string encryptedWord = "";
char[] split = word.ToCharArray();
foreach (char character in split)
{
switch (character)
{
case 'a': encryptedWord += "d"; break;