04-17-2003, 06:58 PM
Hi, nathan. I'm having a really big problem here:
The problem is that board does not reset to board.t each match. In fact, board.t is the same thing as board. I think it's because LISP is linking the variable not SETTING board to the value of board.t I've tried just about every possible thing: eval board.t, setf, psetf, psetq.. and it just keeps resetting.
The only way to make it work right is to load it in from the string array (it converts the picture of the board to numbers) but that is horribly slow:
PLEASSE help! I'm dying here! I can send/post the whole thing if you can't figure it out and still want to help
Code:
(defun play.ant.game () (let()
(setq board.t (create.small.trail))
(setq temp.index 0 ant.match.index 0)
; now wind through the ants.
(loop for cur.match from 1 to (/ ant.amount ant.amount.match) do(let()
(setq board board.t)
(pprint board)
(play.one.round cur.match)
)) ;next cur.match
(if (= disp.scores 1) (disp.ant.scores))
)) ;end play.ant.game
The problem is that board does not reset to board.t each match. In fact, board.t is the same thing as board. I think it's because LISP is linking the variable not SETTING board to the value of board.t I've tried just about every possible thing: eval board.t, setf, psetf, psetq.. and it just keeps resetting.
The only way to make it work right is to load it in from the string array (it converts the picture of the board to numbers) but that is horribly slow:
Code:
(defun load.trail.pic (temp.board.pic) (let((temp.board 0) (i 0) (x 0) (y 0))
(setq size.x (length (aref temp.board.pic 0)) size.y (car (array-dimensions board.pic)))
(setq temp.board (dim 'temp.board size.x size.y))
(loop for x from 1 to size.x do(let()
(loop for y from 1 to size.y do(let()
(setq i (instr alphastring (mid$ (at temp.board.pic y) x)))
(if (<> i 0) (=a temp.board x y (* i -1))
(if (equalp (mid$ (at temp.board.pic y) x) "0") (=a temp.board x y 1)
)) ;end ifs
)) ;next y
)) ;next x
temp.board
)) ;end load.trail.pic
PLEASSE help! I'm dying here! I can send/post the whole thing if you can't figure it out and still want to help
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Visit www.neobasic.net to see rubbish in all its finest.