←back to thread

159 points mpweiher | 1 comments | | HN request time: 0.229s | source
Show context
ajankovic ◴[] No.43673706[source]
I had time to spare so I toyed with the example exercise. Now I am not sure if I misunderstood something because solution is fairly simple using only channels: https://go.dev/play/p/tD8cWdKfkKW
replies(2): >>43673906 #>>43676713 #
1. jtolds ◴[] No.43676713[source]
I replied to your comment on my website, but for posterity here, yes, I do think you did a good job for the part about exiting when bestScore > 100. There's nitpicks, but this is fine! It makes sense, and nice use of a select over a send.

I did expect that this exercise would come after the first one though, and doing this on top of a solution to the first exercise is a bit harder. That said, I also don't mean to claim either are impossible. It's just tough to reason about.