summaryrefslogtreecommitdiff
path: root/lisp/ouat/scrabble-util.lisp
diff options
context:
space:
mode:
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