Skip to content

Commit

Permalink
Fix I/J bug and remove .sgf from ignoree
Browse files Browse the repository at this point in the history
  • Loading branch information
naush committed Jan 24, 2011
1 parent f6591ca commit ea9abc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ pom.xml
lib
classes
.DS_Store
*.sgf
8 changes: 5 additions & 3 deletions src/maru/common/utility/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@

(defn insert-last [ls elm] (concat ls (list elm)))

; ToDo: Fix the I/J bug
(def letter-digit { \A 0 \B 1 \C 2 \D 3 \E 4 \F 5 \G 6 \H 7 \J 8
\K 9 \L 10 \M 11 \N 12 \O 13 \P 14 \Q 15 \R 16
\S 17 \T 18 \U 19 \V 20 \W 21 \X 22 \Y 23 \Z 24 })

(defn letter-to-digit [a] (- (int (Character/toUpperCase a)) 65))
(defn letter-to-digit [a] (get letter-digit (Character/toUpperCase a)))

(defn digit-to-letter [d] (char (+ 65 d)))
(defn digit-to-letter [d] (first (filter #(= d (get letter-digit %)) (keys letter-digit))))

(defn string-to-digit [s] (Integer/parseInt s))

Expand Down

0 comments on commit ea9abc5

Please sign in to comment.