aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert1993-08-01 20:50:07 +0000
committerPaul Eggert1993-08-01 20:50:07 +0000
commitf7e55318b414a72cd0fc81525c2d4983a1033494 (patch)
treed92a6e2e1d1f2abe0c6a997348c6c15070b9e17f
parent6b6d5edf696c11ce2b2ccad2f4b0b3586afa2826 (diff)
downloademacs-f7e55318b414a72cd0fc81525c2d4983a1033494.tar.gz
emacs-f7e55318b414a72cd0fc81525c2d4983a1033494.zip
(random-number): Remove.
All callers changed to use `random' instead.
-rw-r--r--lisp/play/gomoku.el7
1 files changed, 1 insertions, 6 deletions
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index a403f2efddb..0bc047682b5 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -319,16 +319,11 @@ is non-nil."
319 ;; If score is equally good, choose randomly. But first check freeness: 319 ;; If score is equally good, choose randomly. But first check freeness:
320 ((not (zerop (aref gomoku-board square))) 320 ((not (zerop (aref gomoku-board square)))
321 (aset gomoku-score-table square -1)) 321 (aset gomoku-score-table square -1))
322 ((= count (random-number (setq count (1+ count)))) 322 ((zerop (random (setq count (1+ count))))
323 (setq best-square square 323 (setq best-square square
324 score-max score))) 324 score-max score)))
325 (setq square (1+ square))) ; try next square 325 (setq square (1+ square))) ; try next square
326 best-square)) 326 best-square))
327
328(defun random-number (n)
329 "Return a random integer between 0 and N-1 inclusive."
330 (setq n (% (random) n))
331 (if (< n 0) (- n) n))
332 327
333;;; 328;;;
334;;; INITIALIZING THE SCORE TABLE. 329;;; INITIALIZING THE SCORE TABLE.