X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=utils.lisp;h=1dfa25c23e0d9bf2f04e30accb16d635d50eae12;hb=4311ba09f8c501b21745d6da45e17e446d4da2f8;hp=8a3ac40577d047ad9180359642a13ebdab05ab51;hpb=20c849f483c381f84eae22eee807280c8d00e554;p=reversi.git diff --git a/utils.lisp b/utils.lisp index 8a3ac40..1dfa25c 100644 --- a/utils.lisp +++ b/utils.lisp @@ -7,7 +7,7 @@ ;;;; Programer: Kevin M. Rosenberg ;;;; Date Started: 1 Nov 2001 ;;;; -;;;; $Id: utils.lisp,v 1.5 2003/06/12 12:42:13 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file is Copyright (c) 2001-2003 by Kevin M. Rosenberg ;;;; @@ -42,9 +42,10 @@ Like mapcon, but uses append instead of nconc." (apply #'append (mapcar fn list))) -(defun random-elt (seq) - "Pick a random element out of a sequence." - (elt seq (random (length seq)))) +(defun random-nth (list) + (declare (list list)) + "Pick a random element out of a list." + (nth (random (length list)) list)) (defun concat-symbol (&rest args) "Concatenate symbols or strings to form an interned symbol"