(let
[check (fn [& sets]
(first (filter #(not (nil? %))
(map
(fn [ss]
(let [r (first (filter #(or (= % #{:x}) (= % #{:o})) ss))]
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 pentabonacci) | |
(defn count-odd-pentaFib [n] | |
(case n | |
0 0 | |
1 1 | |
2 1 | |
3 1 | |
4 1 | |
(loop [n (- n 1) odds 1 a 1 b 1 c 2 d 4 e 8] |
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 anagram-difference) | |
(defn add-to-bag [bag item] | |
(update bag item (fnil inc 0))) | |
(defn sub-from-bag [bag item] | |
(update bag item (fnil dec 0))) | |
(defn anagram-difference [w1 w2] | |
"Example |
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
let | |
inherit (import <nixpkgs> {}) fetchFromGitHub; | |
nixpkgs = import (fetchFromGitHub { | |
owner = "NixOS"; | |
repo = "nixpkgs"; | |
rev = "9ebc6ad944c9e53f58536ef50c64b6f057e5fa4c"; | |
sha256 = "1hv53kw8nwg9k3kim19ykbmn3yksgmlw1gjbd6d5midhmjjc6mhv"; | |
}); | |
overlays = [(self: super: { | |
python36 = super.python36.override { |
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
print ("Hello") | |
#Set the frogs variable | |
frogs = 2 | |
print ("Here are {} frogs".format(frogs) | |
suggestion = "Let's breed them" | |
respect = ", don't watch it's rude" | |
initialization = (suggestion + respect) | |
def double_frogs(frogs): | |
"""Doubles your frogs!""" |
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
def double_frogs(frogs): | |
"""Doubles your frogs!""" | |
return frogs * 2 |