From 77454056d059762e6ca5f78de5f335f3fc5112b9 Mon Sep 17 00:00:00 2001 From: Pavel Vavilin Date: Tue, 17 Feb 2026 15:16:41 +0500 Subject: [PATCH] fix for mutual recursion bug --- src/pegthing/core.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pegthing/core.clj b/src/pegthing/core.clj index 40677c5..8b63113 100644 --- a/src/pegthing/core.clj +++ b/src/pegthing/core.clj @@ -1,5 +1,5 @@ (ns pegthing.core - (require [clojure.set :as set]) + (:require [clojure.set :as set]) (:gen-class)) (declare successful-move prompt-move game-over prompt-rows) @@ -217,10 +217,10 @@ (println "Move from where to where? Enter two letters:") (let [input (map letter->pos (characters-as-strings (get-input)))] (if-let [new-board (make-move board (first input) (second input))] - (successful-move new-board) + #(successful-move new-board) (do (println "\n!!! That was an invalid move :(\n") - (prompt-move board))))) + #(prompt-move board))))) (defn successful-move [board] @@ -253,9 +253,9 @@ (println "How many rows? [5]") (let [rows (Integer. (get-input 5)) board (new-board rows)] - (prompt-empty-peg board))) + #(prompt-empty-peg board))) (defn -main [& args] (println "Get ready to play peg thing!") - (prompt-rows)) + (trampoline prompt-rows))