Just for fun: Countdown numbers game solver

Arnaud Delobelle arnodel at googlemail.com
Mon Jan 21 12:11:55 EST 2008


On Jan 21, 9:01 am, dg.google.gro... at thesamovar.net wrote:

> Arnaud: I haven't had time to play with your solution yet - how quick
> does it run?

Ok I've done some quick timings, it's faster than I remembered it:

numbers = [2, 4, 5, 8, 25]
target = 758

Average time to find
(1) best solution (in terms of length of repr): 0.0418s
(2) first solution: 0.00421s

(2.2GHz MacBook Pro, done with the timeit module)

(1) involves working out all possible calculations with the 6 numbers.

--
Arnaud




More information about the Python-list mailing list