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
dawgroot AA AB AD AE AG AH AI | |
000000 00400076 01800000 02800000 04800000 05800000 07800000 08800000 09800000 | |
AL AM AN AR AS AT AW AX | |
000008 0c800000 0d800000 0e800000 12800000 13800000 14800000 17800000 18800000 | |
AY BA BE BI BO BY CH DA/PA/TA | |
000010 19c00000 01800000 05800000 09800000 0f800000 19c00000 08c00000 01800000 | |
DE/PE/TE DI/PI/TI DO/PO/TO EA ED EE EF EH |
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
#!/usr/bin/perl -w | |
# JumbleTime-style quiz program. Copyright(C) Amit Chakrabarti, 2003-2007. | |
# Last updated Tue Feb 6 18:44:53 EST 2007. | |
# | |
# Modifying this program is allowed. If you add any interesting features | |
# please notify me by email: <amitc at ias dot edu>. I will try to keep | |
# a "latest" version of this program at the following URL: | |
# http://www.cs.princeton.edu/~amitc/Scrab/jt | |
# |
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
(defvar *vowel-first* t) | |
(defvar *twl98* (make-hash-table :test 'equal)) | |
(defvar *twl06* (make-hash-table :test 'equal)) | |
(defvar *twl14* (make-hash-table :test 'equal)) | |
(defvar *csw12* (make-hash-table :test 'equal)) | |
(defvar *csw15* (make-hash-table :test 'equal)) | |
(defvar *pbs* (make-hash-table :test 'equal)) | |
(defun load-twl98 () | |
(load-dict "/Users/john/scrabble/twl98.txt" *twl98*)) |
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
(use 'clojure.contrib.duck-streams) | |
(import '(org.eclipse.swt SWT)) | |
(import '(org.eclipse.swt.browser Browser)) | |
(import '(org.eclipse.swt.layout GridData GridLayout)) | |
(import '(org.eclipse.swt.widgets Display Label Shell Text Widget)) | |
(import '(org.eclipse.swt.graphics Font)) | |
(import '(org.eclipse.swt.events ModifyListener VerifyListener)) | |
(def *display* (new Display)) |
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 time | |
start_time = time.time() | |
words = [] | |
while time.time() - start_time < 20: words += [raw_input()] | |
print words |
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.List (permutations,sort) | |
import Data.Map (Map,lookup,fromListWith,mapWithKey,toList) | |
import Data.Maybe | |
wordPairs :: String -> [(String,Char)] | |
wordPairs x = wordPairs' (" " ++ x ++ " ") | |
wordPairs' (a:b:c:xs) = ([a,b],c):(wordPairs' (b:c:xs)) | |
wordPairs' _ = [] | |
getAssocs :: Fractional a => String -> [((String,Char),a)] |
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
#include <iostream> | |
#define PRINT_RACKS 0 | |
static const char NUM_TILES = 27; | |
int main(int argc, char **argv) { | |
char tiles[NUM_TILES][2] = { | |
{'A', 9}, {'B', 2}, {'C', 2}, {'D', 4}, {'E', 12}, {'F', 2}, {'G', 3}, | |
{'H', 2}, {'I', 9}, {'J', 1}, {'K', 1}, {'L', 4}, {'M', 2}, {'N', 6}, |
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 Math.Combinatorics.Multiset | |
bag = fromList $ "AAAAAAAAABBCCDDDDEEEEEEEEEEEEFFGGGHHIIIIIIIIIJKLLLLMM" ++ | |
"NNNNNNOOOOOOOOPPQRRRRRRSSSSTTTTTTUUUUVVWWXYYZ??" | |
main = print $ length $ kSubsets 7 bag |
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.List | |
main = interact $ show . filter isPalin . (>>= subsequences) . words | |
where isPalin x = length x>=10 && x==reverse x | |
-- ["CIOALLAOIC","DEOISSIOED","ESSENNESSE","ESSENTNESSE","ESSENINESSE", | |
-- "ESSENANESSE","ESSENLNESSE","LACIOOICAL","LACIOLOICAL","SEITIITIES", | |
-- "SEITIVITIES","KINNIINNIK","KINNIKINNIK","KINNIINNIK","KINNIKINNIK", | |
-- "NOINEENION","NOINERENION","NOINEVENION","NOITEETION","NOITERETION", | |
-- "NOITEVETION","NORETTERON","NORETHTERON","NORETITERON","NORETSTERON", |
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 std.bigint; | |
import std.stdio; | |
BigInt bigPow(BigInt x, int n) { | |
BigInt answer = 1; | |
for (auto i = 0; i < n; i++) { | |
answer *= x; | |
} | |
return answer; | |
} |
NewerOlder