From: ········@acm.org
Subject: Re: Error. I'm not sure what to do.
Date: 
Message-ID: <cCKD7.9515$Fy2.1838647@news20.bellglobal.com>
······@rocketmail.com (Hank B.) writes:
> Here is the error:
> 
> *** - READ: input stream #<STRING-CHAR-FILE-STREAM #"interface.lsp">
> ends within an object

Reformatting a tad:

(defun showgame (Board)           ;;display game state
  (let 				;;assign local variables
      ((playerone (car Board)) 
       (captureone (cadr Board))
       (playertwo (caddr Board)) 
       (capturetwo (cadddr Board))))
        ;;; Are you sure it's of any value to bind these values when you never
        ;;; use them?
  (print 'afterlet)
  (format t "~8T~a~4T~a~4t~a~4T~a~4T~a~4T~a~%")  ;;player 1's pits
  (format t "~8T~1~4T~2~4t~3~4T~4~4T~5~4T~6~%")  ;;position #s
  (format t "~5T~a~26T~a~%")   		       ;;capture pits
  (format t "~8T~a~4T~a~4t~a~4T~a~4T~a~4T~a~%")  ;;player 2's pits
  (format t "~8T~1~4T~2~4t~3~4T~4~4T~5~4T~6~%")  ;;position #s
  (format t "~%%"))

  ;;; Note that these format statements have no arguments, so they
  ;;; won't work, and a compiler that realizes that you're using
  ;;; format strings, and so compiles the format strings, may notice
  ;;; that you haven't enough arguments being passed to them...

(print 'aftershowgame)

;;; I'd say that the following is quite the winner...  Would you not
;;; think it sensible to have the argument to choosePit be a set of
;;; variable names as opposed to a LET environment?

(defun choosePit ((let ((chosenPit -1)) 
		    (format t "Enter a pit number: ")
		    (setq chosenPit (read))	
		    (cond
		      ((and (<  chosenPit 7) (> chosenPit 0)) chosenPit)   
		      (t (format t "Not a valid pit. Try again.~%") 
			 (print (choosepit))))))
  
  (print "after choosepit")
  (print (choosePit))
  (setq Board (spread Board chosenPit))
  (showgame (Board))
  (isWin (Board))  
  
  (setq Board (spread Board (bestFirstSearch Board)))
  (setq Board (spread Board chosenPit))
  (showgame (Board))
  (isWin (Board))			    
  (choosePit (chosenPit))          
-- 
(concatenate 'string "cbbrowne" ·@cbbrowne.com")
http://www.cbbrowne.com/info/unix.html
What do you get when you multiply six by nine?
From: Kent M Pitman
Subject: Re: Error. I'm not sure what to do.
Date: 
Message-ID: <sfw3d40o2jz.fsf@world.std.com>
········@acm.org writes:

> (defun choosePit ((let ((chosenPit -1)) 
> 		    (format t "Enter a pit number: ")
> 		    (setq chosenPit (read))	
> 		    (cond
> 		      ((and (<  chosenPit 7) (> chosenPit 0)) chosenPit)   
> 		      (t (format t "Not a valid pit. Try again.~%") 
> 			 (print (choosepit))))))
>   
>   (print "after choosepit")

Isn't this "before" choosepit?

>   (print (choosePit))
>   (setq Board (spread Board chosenPit))
>   (showgame (Board))
>   (isWin (Board))  
>   
>   (setq Board (spread Board (bestFirstSearch Board)))
>   (setq Board (spread Board chosenPit))
>   (showgame (Board))
>   (isWin (Board))			    
>   (choosePit (chosenPit))