Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
na_th_an...
#1
Hi, nathan. I'm having a really big problem here:

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! Sad I can send/post the whole thing if you can't figure it out and still want to help Smile
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.
Reply
#2
Hmmm so the problem is that (setq board board.t) is not working... Well, I can do some research, but you'll have to wait until monday when I get to my other PC (in the place where I study) where I have my documentation and my interpreter.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
I had to do a workaround.

I called a sub that called a sub that read off from the board one at a time and returned the temp board, then the return val was setqed to the board.....

i am getting more crazy stuff now, something is wrong here:

instead of adding one it adds like (2^16-1)/2^16...
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.
Reply
#4
I isolated the problem, but I still can't fix it. Here is some code that shows the problem:

Code:
(defun dim (x a &optional (b 0) (c 0)) (let()
(if (= c 0)
(if (= b 0)
(setq x (make-array (cons a nil):initial-element 0))
(setq x (make-array (cons a (cons b nil)):initial-element 0))
) ;end if
(setq x (make-array (cons a (cons b (cons c nil))):initial-element 0))
) ;end if
)) ;end dim

(setq b1 (dim 'b1 4 4))
(setq b2 b1)
(setf b2 0)
(setq b2 (aref b2 1 1) 1)
(pprint b2)
(pprint b1)

So, it print b2, and it comes out with a 1 at position (1, 1)
But when I print b1, it equals b2...
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.
Reply
#5
top. sorry.
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.
Reply
#6
working on it...
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#7
:|
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)