Re: channels operations

2015-01-10 Thread Chris Freeman
You might want to put it into a loop, keeping the 'played' values as the loop bindings. (I imagine [false false] in my head, but whatever is meaningful to you.) If the timer dings, you evaluate the winner. If you get a value on a player channel and the other player HAS played, you might recur wit

Re: channels operations

2015-01-10 Thread Erik Price
Not sure if it’s “proper”, but you could just alts! twice on all three channels: (let [[_ p1] (alts! [player1-ch player2-ch timeout-ch]) [_ p2] (alts! [player1-ch player2-ch timeout-ch])] (cond (= p1 timeout-ch) "No players played." (= p2 timeout-ch) (str p1 " played, and the other