(defn juggle [p1 n] (let [x1 (get p1 0)
x2 (get p1 1)
x3 (get p1 2)]
(if(even? n)
(replace [x1 x2 x3] [1 0 2])
(replace [x1 x2 x3] [0 2 1])
)
)
)
(println(juggle [1 2 3] 8))
To embed this program on your website, copy the following code and paste it into your website's HTML: