Just for fun: Countdown numbers game solver

Paul Rubin http
Mon Jan 21 04:24:32 CET 2008


Terry Jones <terry at jon.es> writes:
> Here's a solution that doesn't use any copying of lists in for recursion.
> It also eliminates a bunch of trivially equivalent solutions. The countdown
> function is 37 lines of non-comment code.  Sample (RPN) output below.

Nice, I realized after I posted my 2nd solution that it was missing
some cases and it's good to see confirmation that 239 is reachable.
I'll see if I can fix my version.  I think the list copying is ok
given that the recursion depth always must be fairly small if the
generator is to complete in any reasonable amount of time.



More information about the Python-list mailing list