The Rosetta Code Blog this week mentioned that entries starting with a K were missing so I reviewed my sources and added a knapsack type problem to RC together with the python solution.
It's not the first time that I've remembered that itertools.product can do arbitrary nested for loops. Before, I would have had to employ recursive function calls.
- Paddy.
Mainly Tech projects on Python and Electronic Design Automation.
Tuesday, December 02, 2008
Subscribe to:
Post Comments (Atom)
Any leads on a task starting with Y? :)
ReplyDeleteThe only thing I could think of would be a program to score or play the game Yahtzee, but the game is commercial.
ReplyDeleteI'll come up with something for Y.
ReplyDeleteHi Michael,
ReplyDeleteHow you doin' on Y ?
Finding a task starting with Y was difficult. I finally came up with Yuletide Holiday at http://www.rosettacode.org/wiki/Yuletide_Holiday
ReplyDelete"
A company decides that whenever Xmas falls on a Sunday that they will give their workers all extra paid holidays so that, together with any public holidays, workers will not have to work the following week (between the 25th of December and the first of January).
In what years between 2008 and 2121 will the 25th of December be a Sunday?
Using any standard date handling libraries of your programming language; compare the dates calculated with the output of other languages to discover any anomalies in the handling of dates which may be due to, for example, overflow in types used to represent dates/times similar to y2k type problems.
"
- Paddy.