summaryrefslogtreecommitdiff
path: root/lisp/ouat/scrabble-util.lisp
diff options
context:
space:
mode:
authorJason Katz-Brown <jason@airbnb.com>2013-08-25 02:17:13 -0700
committerJason Katz-Brown <jason@airbnb.com>2013-08-25 02:17:13 -0700
commit9306cb60c32082c5403931de0823a9fd5daa196c (patch)
treeca1b6eb695fdf3f0c2294e92416b272164bae642 /lisp/ouat/scrabble-util.lisp
parent8fb2c681cecc01b46b0f4ba02d5cc177c4747b1c (diff)
Initial git commit.
Diffstat (limited to 'lisp/ouat/scrabble-util.lisp')
-rw-r--r--lisp/ouat/scrabble-util.lisp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/ouat/scrabble-util.lisp b/lisp/ouat/scrabble-util.lisp
new file mode 100644
index 0000000..0d9d1a3
--- /dev/null
+++ b/lisp/ouat/scrabble-util.lisp
@@ -0,0 +1,17 @@
+(in-package :ouat)
+
+(defun row2uv-row (row)
+ (format nil "~A" (i1+ row)))
+
+(defun col2uv-col (col)
+ (string (code-char (i+ #.(char-code #\A) col))))
+
+(defun uv-row2row (row)
+ (i1- (parse-integer row)))
+
+(defun uv-col2col (col)
+ (i- (char-code (elt col 0))
+ #.(char-code #\A)))
+
+(defconstant +empty+ 0)
+(defconstant +all-letters+ -1) \ No newline at end of file