Created
September 13, 2009 23:55
-
-
Save digash/186383 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
;;;; Copyright (c) 2009 Dimitry Gashinsky. No rights reserved. | |
;;;; | |
;;;; Author: Dimitry Gashinsky (dimitry :at gashinsky :dot com) | |
;;;; Id: 93E701E6-D3B0-44C8-B569-4B2BB2717ADB | |
(ns animals) | |
(def *animals* `(Ant Antelope Aardvark Armadillo Albatross Alligator Anaconda Alpaca anteater Ape Bear Bee Bird Bat Bonobo Beaver Badger Bobcat Baboon Baracuda Bullfrog Bull Buffalo Budgie Billy goat Bison Boa Constrictor Beluga Butterfly Boar Cat Chicken Chimpanzee Chinchilla Chicken Camel Cheetah Chipmunk Caribou Cougar Canary Cricket Crab Crocodile Caiman Cockroach Caterpillar Catfish Crawfish Crow Cod Cockatiel Cockatoo Coho Coyote Cuckaburra Cookoo bird Cow Coney Dog Duck Deer Dolphin Dingo Dragonfly DoDo bird Dolly Vardon Donkey Dormouse Dik-dik Elephant Emu Eagle Eel Egret Eclectus Erne Elk Enchydna Fish Flamingo Fly Fox Firefly Frog Feret Finch Flatworm Falcon Giraffe Goat Gazelle Gorilla Grasshopper Groundhog Gopher Goose Horse Hippopotamus Hyena Heron Herring Hydra hare Hawk Hammerhead Shark Hedgehog Hyrax Iguana Impala Insect Jaguar Jellyfish Jackrabbit Jackal Junebug Jack Ass Kangaroo Killer Whale Koala Bear Krill Komodo Dragon Kingfisher King kobra Lion Leopard Lemur Lemming Lobster Leech Lamb Lancelet Lynx llama lice Monkey Mongoose Moose Muskrat Mink Marmot musk ox Man-Of-War Manatee mole Mouse Mule Meerkat Newt Narwhal Nutria Nyala Nautilus Naked Mole Rat Orangutan Otter Ostrich Octopus Ox Osprey Orca OcelotOkapi Penguin Peacock Preying Mantis Pelican Platypus Porcupine Poupou Pig Prawn Pigeon PantherPotto Puma Quail Quetzal Rat Rabbit Rooster Raccoon Rhinoceros Roundworm Ringworm Robin Squirrel Sheep Snail Snake Sloth Seal Sea Lion Skunk Shark Squid Sea anemone Scorpion Scallop Shrimp Stork Starfish Seahorse Swordfish swan Sandpiper Tasmanian Devil Tortoise Turtle Tiger Tarntula Tick Tapeworm Tapir Turkey Urchin Uakari Vole Viper Vulture Vicuna Whale Walrus Warthog Weasel Woodchuck Wolf Wolverine Wildebeest Wombat Woodpecker Wallaby Xantus Xiphactinus Audax Yak Zebra Zebu)) | |
(def *words* (.split (slurp "/usr/share/dict/words") "\n")) | |
(defn sum-letters [word] | |
[word (apply + (map #(-> % int (- (int \A)) (+ 1)) (.toUpperCase word)))]) | |
(def animal100 (filter (fn [[_ s]] (= s 100)) (map #(-> % name sum-letters) *animals*))) | |
(doseq [[w c] (sort animal100)] (println w)) | |
(def word100 (filter (fn [[_ s]] (= s 100)) (map sum-letters *words*))) | |
;; print 50 random words that add up to a hundred | |
(doseq [[w c] (sort (take 50 (repeatedly #(nth word100 (rand-int (count word100))))))] | |
(println w)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment