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
fizz_word = fn | |
0, 0, _ -> "FizzBuzz" | |
0, _, _ -> "Fizz" | |
_, 0, _ -> "Buz" | |
_, _, x -> x | |
end | |
fizz_buzz = fn n -> fizz_word.(rem(n, 3), rem(n, 5), n) end | |
Enum.each 1..100, fn(n) -> IO.puts(fizz_buzz.(n)) end |
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
My Ten Favorite Books I Read in 2014 | |
Quiet: The Power of Introverts in a World That Can't Stop Talking - Susan Cain | |
My Brilliant Friend (Honorable mention: The Days of Abandonment) - Elena Ferrante | |
i will never be beautiful enough to make us beautiful together - Mira Gonzalez | |
How Should a Person Be? - Sheila Heti | |
My Struggle: Book 1 (Honorable mentions: Book 2, Book 3)- Karl Ove Knausgaard | |
Preparation For The Next Life - Atticus Lish | |
Crapalachia - Scott McClanahan | |
Citizen: An American Lyric - Claudia Rankine |
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
#lang racket | |
(define min 0) | |
(define max 100000000) | |
(define (recursive-function n) | |
(if (>= n max) | |
n | |
(recursive-function (+ n 1)))) |
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
x :: Int -> Int -> Int | |
x other = (* other) | |
main = (putStrLn . show) (9 `x` 9) | |
-- 81 |
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
In Ruby, your information (or data) can come in different types. | |
Let's learn about three to start: numbers, booleans, and strings. | |
Let's set a variable `my_num` to the value 25 | |
my_num = 25 | |
Let's set a variable `my_boolean` to the value true | |
my_boolean = true | |
Set `my_string` to "Ruby" |
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
# irb... | |
# Numbers | |
3 + 2 | |
# Strings | |
puts "Hi, everybody!" | |
# Booleans | |
true | |
false |
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
(/ | |
(+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) | |
(* 3 (- 6 2) (- 2 7))) | |
(defn square [x] | |
(* x x)) | |
(defn sum-of-squares [x y] | |
(+ (square x) (square y))) |
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
import Data.Maybe | |
-- Lazy evaluation | |
natNums = [1..] | |
odds = [1,3..] | |
evens = [2,4..] | |
addXAndY :: Integer | |
addXAndY = sum | |
where x = 1 |
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
The Verificationist - Donald Antrim | |
what purpose did i serve in your life - Marie Calloway | |
The Last Samurai - Helen DeWitt | |
The White Album - Joan Didion | |
The Orphan Master's Son - Adam Johnson | |
Taipei - Tao Lin | |
The Twelve Tribes of Hattie - Ayana Mathis | |
The Road - Cormac McCarthy | |
Swamplandia! - Karen Russell | |
Journalism - Joe Sacco |
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
main :: IO() | |
main = do | |
putStrLn $ show result | |
where result = sum $ take 100000 (zipWith (*) [2,4..] [1,3..]) |