Hacker News new | past | comments | ask | show | jobs | submit login
Python solutions to the 99 Prolog Problems
57 points by mustpax on Aug 17, 2009 | hide | past | favorite | 8 comments



In Lisp: http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/func...

In Haskell: http://www.haskell.org/haskellwiki/H-99:_Ninety-Nine_Haskell...

I found that actually solving these in Haskell reduced to "how familiar are you with the standard library"". It seems to be very similar in Python.


The simple 13-line Haskell solution to P27 is an interesting contrast to the 27-line Python solution with its two layers of indirection. The Haskell solution is much more declarative. (If you ported some of the Haskell Prelude to Python you might be able to write something similar, though without the nice List Monad syntax.)


"99 Prolog Problems" is a set of problems to solve in Prolog to teach yourself the language. It works well as an educational tool in other languages as well.

Original problem set: https://prof.ti.bfh.ch/hew1/informatik3/prolog/p-99/



Makes it look easy. Python is poetry in $EDITOR.


Just to note, only the first 50 have been solved in python as yet.


If you're having language problems I feel bad for you son, I got 99 prolog problems and python ain't one.


This kind of stuff is Python's strength :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: