[Haskell-beginners] Peer review of an attempt to solve the golf-tee puzzle?
Scott Thoman
scott at thoman.org
Wed Oct 5 17:02:24 CEST 2011
Hi,
I'm looking to see of anyone is interested in a quick code review. I
coded a quick solution to the golf-tee puzzle (like you see a places
like Cracker Barrel, 15 piece triangle where you hop the pegs in order
to get down to one left). My solution seems to work, seems to perform
ok, and seems to come up with a very large number of distinct
solutions.
I'm looking for some feedback as far as:
- am I "getting" it? :)
- is the approach general enough?
- does it look anything like idiomatic haskell?
- any places to make things simpler or more point-free-ish?
- any types are overkill, too restrictive (I added the Board type so
maybe it could be an instance of Show to display the triangle but
didn't go that far)
I'll attach the three files here.
Thanks in advance for any feedback...
/stt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TeeBoard.hs
Type: text/x-haskell
Size: 4404 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/beginners/attachments/20111005/cbae43ad/attachment.hs>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TriangleTeeBoard.hs
Type: text/x-haskell
Size: 2108 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/beginners/attachments/20111005/cbae43ad/attachment-0001.hs>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: solver.hs
Type: text/x-haskell
Size: 597 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/beginners/attachments/20111005/cbae43ad/attachment-0002.hs>
More information about the Beginners
mailing list