From: Jim Menard Date: 2006-01-01T03:26:40+09:00 Subject: Re: [QUIZ] Numeric Maze (#60) On 12/31/05, James Edward Gray II wrote: > On Dec 30, 2005, at 5:51 PM, Robert Retzbach wrote: > > > Hello. > > I really enjoyed this puzzle, but my brain and my cpu are burning. > > > > In a german ruby channel we used the example 22->999. > > My really slow brute force algo came up with > > 122002000200212 > > > > 0 - double > > 1 - halve > > 2 - add_two > > > > It took 20-30min :D > > $ time ruby numeric_maze.rb 22 999 > 22, 24, 26, 28, 30, 60, 62, 124, 248, 496, 498, 996, 1992, 1994, 997, > 999 > > real 0m0.635s > user 0m0.381s > sys 0m0.252s > > ;) > > James Edward Gray II Damn. I got it down from 7 minutes to 18 seconds on a 667 MHz PPC, but it looks like I have a bit more work to do. Jim -- Jim Menard, jim.menard@gmail.com, jimm@io.com http://www.io.com/~jimm "Generics in Java are an apology for having collections of Objects, and are somewhat like the puritan's suspicion that someone, somewhere, might be enjoying themselves." -- Steven T Abell in comp.lang.smalltalk