diff options
author | Jason Katz-Brown <jason@airbnb.com> | 2013-08-25 02:17:13 -0700 |
---|---|---|
committer | Jason Katz-Brown <jason@airbnb.com> | 2013-08-25 02:17:13 -0700 |
commit | 9306cb60c32082c5403931de0823a9fd5daa196c (patch) | |
tree | ca1b6eb695fdf3f0c2294e92416b272164bae642 /lisp/ouat/scrabble-test.lisp | |
parent | 8fb2c681cecc01b46b0f4ba02d5cc177c4747b1c (diff) |
Initial git commit.
Diffstat (limited to 'lisp/ouat/scrabble-test.lisp')
-rw-r--r-- | lisp/ouat/scrabble-test.lisp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/lisp/ouat/scrabble-test.lisp b/lisp/ouat/scrabble-test.lisp new file mode 100644 index 0000000..76f8425 --- /dev/null +++ b/lisp/ouat/scrabble-test.lisp @@ -0,0 +1,55 @@ +(in-package :ouat) + +(defun test-opening-tops () + (do-file-lines (line (string-append *test-directory* "racks.txt")) + (let* ((rack (new-rack line)) + (tops (topsquiet nil rack nil)) + (score (if tops (move-score (first tops)) 0)) + (tops-strings (mapcar (lambda (move) + (move-string move *english*)) + tops)) + (answer (list :rack line + :score score + :tops tops-strings)) + (*print-pretty* nil)) + (format t "~s~%" answer)))) + +(defun test-sq-infos () + (let* ((b (new-board *standard*)) + (re (make-move :action :place + :direction :horizontal + :start-row 7 + :start-col 6 + :word #(18 5) + :blank-ps #(nil nil) + :already-on-board-ps #(nil nil))) + (as (make-move :action :place + :direction :vertical + :start-row 2 + :start-col 5 + :word #(1 19) + :blank-ps #(nil nil) + :already-on-board-ps #(nil nil))) + (in (make-move :action :place + :direction :horizontal + :start-row 7 + :start-col 10 + :word #(9 14) + :blank-ps #(nil nil) + :already-on-board-ps #(nil nil))) + (d (make-move :action :place + :direction :horizontal + :start-row 7 + :start-col 13 + :word #(4) + :blank-ps #(nil) + :already-on-board-ps #(nil)))) + (place-move b re) + (place-move b in) + (place-move b d) + (place-move b as) + #+nil (print-board b) + (update-sq-infos b *twl* *english* nil) + (format t "sq-infos: ~a~%" (board-sq-infos b)))) + + |