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) | |
(defn a-hooks [] | |
(let [words (map seq (read-lines "/home/john/scrabble/twl.txt")) | |
eights (filter (fn [word] (= 8 (count word))) words) | |
sevens (set (filter (fn [word] (= 7 (count word))) words))] | |
(loop [[eight & more-eights] eights] | |
(let [[first-letter & rest-of-word] eight] | |
(when (= \A first-letter) | |
(when (contains? sevens rest-of-word) |
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
(defun a-hooks () | |
(let* ((sevens (make-hash-table :test 'equal)) | |
(eights (with-open-file (stream "/home/john/scrabble/twl.txt") | |
(loop | |
for word = (read-line stream nil) while word | |
for length = (length word) | |
when (= 7 length) | |
do (setf (gethash word sevens) t) | |
when (and (= 8 length) | |
(char= #\A (elt word 0))) |
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 <string> | |
#include <set> | |
#include <list> | |
#include <fstream> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
set<string> sevens; |
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
infile = open("twl.txt", "r") | |
sevens_set = set() | |
eights_list = [] | |
for line in infile: | |
word = line.strip() | |
if len(word) == 7: | |
sevens_set.add(word) | |
elif len(word) == 8 and word[0] == 'A': | |
eights_list.append(word) |
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
require 'set' | |
sevens = Set.new | |
eights = [] | |
for line in open("/home/john/scrabble/twl.txt") do | |
word = line.strip | |
if word.size == 7 then | |
sevens << word | |
elsif word.size == 8 and /^A/ === word |
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 '(org.eclipse.swt SWT)) | |
(import '(org.eclipse.swt.widgets Display Shell Widget)) | |
(import '(org.eclipse.swt.graphics Font)) | |
(import '(org.eclipse.swt.events ControlAdapter)) | |
(import '(org.eclipse.swt.custom StyleRange StyledText VerifyKeyListener)) | |
(def *display* (new Display)) | |
(def *shell* (new Shell *display*)) | |
(def *repl* (new StyledText *shell* SWT/BORDER)) | |
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-package #:ouat) | |
(defun jqxz+1-stems () | |
(let ((racks-that-bingo-through-jqxz | |
(unique | |
(loop | |
for big-tile across "JQXZ" | |
for ana-pattern = (format nil "~a???????" big-tile) | |
append (steal-tiles ana-pattern)))) | |
(jqxz+1-stems nil)) |
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
(defstruct lazy-seq | |
head | |
tail | |
known-tail) | |
(defun head (seq) | |
(lazy-seq-head seq)) | |
(defun tail (seq) | |
(or (lazy-seq-known-tail seq) |
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
;; -*-lisp-*- | |
(in-package :stumpwm) | |
(load "/home/john/lisp/stumpwm-0.9.5/contrib/amixer.lisp") | |
;; MODE-LINE/MESSAGES | |
(set-font "-misc-fixed-bold-r-normal--13-100-100-100-c-70-iso8859-1") | |
(setf *timeout-wait* 12) |
OlderNewer