Created
September 9, 2009 21:43
-
-
Save olaugh/184106 to your computer and use it in GitHub Desktop.
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)) | |
(dolist (rack racks-that-bingo-through-jqxz) | |
(let ((ana-pattern (format nil "~a?" rack))) | |
(multiple-value-bind (words blanks) | |
(anagram-stem ana-pattern) | |
(when (and (= 2 (length words)) | |
(string/= (first blanks) | |
(second blanks))) | |
(push rack jqxz+1-stems))))) | |
jqxz+1-stems)) | |
(defun woadwage-bingos (n) | |
(let ((bag (coerce *scrabble-bag* 'list))) | |
(labels ((draw-random-rack () | |
(coerce (subseq (shuffle bag) 0 7) 'string))) | |
(loop | |
for i below n | |
for rack = (draw-random-rack) | |
count (woadwage rack))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment