summaryrefslogtreecommitdiff
path: root/chess-random.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-22 19:23:45 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-22 19:23:45 +0000
commit62c13bcfa1933274be856ac5840a933bbaca5f27 (patch)
tree81e2d4ab1a749a4d2561e824708abd60a04d67d0 /chess-random.el
parent171cc1aceb0e9acafe329ff6cd0ca1e2852876ce (diff)
Bug fixes and reducing the TODO list.
Diffstat (limited to 'chess-random.el')
-rw-r--r--chess-random.el11
1 files changed, 2 insertions, 9 deletions
diff --git a/chess-random.el b/chess-random.el
index c6cbe1c..fc41853 100644
--- a/chess-random.el
+++ b/chess-random.el
@@ -10,7 +10,7 @@
(defvar pieces-vector [?r ?n ?b ?q ?k ?b ?n ?r])
-(defun shuffle-vector (vector)
+(defun chess-shuffle-vector (vector)
"Randomly permute the elements of VECTOR (all permutations equally likely)"
(let ((i 0)
j
@@ -28,7 +28,7 @@
(defun chess-fischer-random-position ()
(let (pieces position)
(while (null position)
- (setq pieces (shuffle-vector pieces-vector))
+ (setq pieces (chess-shuffle-vector pieces-vector))
(let (first-bishop first-rook king)
(catch 'retry
(dotimes (i 8)
@@ -57,13 +57,6 @@
(chess-pos-set-piece position (chess-rf-to-index 7 i)
(upcase (aref pieces i))))
- ;; jww (2002-04-12): Until I fully support Fischer Random
- ;; castling, I will disable it here
- (chess-pos-set-can-castle position ?K nil)
- (chess-pos-set-can-castle position ?Q nil)
- (chess-pos-set-can-castle position ?k nil)
- (chess-pos-set-can-castle position ?q nil)
-
position))
(provide 'chess-random)