Skip to content

Instantly share code, notes, and snippets.

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
@olaugh
olaugh / jt.pl
Created September 6, 2023 15:57
#!/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
#
(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*))
(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))
import time
start_time = time.time()
words = []
while time.time() - start_time < 20: words += [raw_input()]
print words
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)]
#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},
import Math.Combinatorics.Multiset
bag = fromList $ "AAAAAAAAABBCCDDDDEEEEEEEEEEEEFFGGGHHIIIIIIIIIJKLLLLMM" ++
"NNNNNNOOOOOOOOPPQRRRRRRSSSSTTTTTTUUUUVVWWXYYZ??"
main = print $ length $ kSubsets 7 bag
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",
@olaugh
olaugh / gist:3277561
Created August 6, 2012 18:59
dlang bignum example
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;
}