हैलो में है, तो हैलो मैं lisp में घोंसला बनाने की कोशिश कर रहा हूं, लेकिन हम त्रुटि प्राप्त करते रहते हैं, और हम नहीं जानते कि इसे कैसे ठीक किया जाए!अगर lisp
** - EVAL: विशेष ऑपरेटर के लिए भी कई मापदंडों यदि:
(defun spread-stones-helper(game-state StoneInHand Player player-index pit-index)
;; Do we have more stones in our hand?
(if (> 0 StoneInHand)
;; Are we above the pit limit?
(if (> pit-index 5)
;; Switch the player and reset the pit-index to 0
(setq player-index (switchplayer player-index))
(setq pit-index '0)
)
;; Add 1 to the pit
(set-pit game-state player-index (GetCorrectPit player-index pit-index) (+ (get-pit game-state player-index (GetCorrectPit player-index pit-index)) 1))
;; Recursive call the function, with one less stone and 1 up in pit-index
(spread-stones-helper game-state (- StoneInHand 1) Player player-index (+ pit-index 1))
)
;; There are no more stones in hand, run capture stones
;; (captureStones game-state StoneInHand Player player-index pit-index)
)
मुझे लगता है कि आप शायद अपने आप को अजीब माता-पिता/इंडेंटेशन शैली के साथ भ्रमित कर रहे हैं। – Ken