Re: Brain going crazy with recursive functions

2008-12-07 Thread Lie Ryan
On Sat, 06 Dec 2008 23:33:35 -0800, 5lvqbwl02 wrote: > I'm trying to solve the 9-tile puzzle using as functional an approach as > possible. I've recently finished reading SICP and am deliberately > avoiding easy python-isms for the more convoluted scheme/functional > methods. The following funct

Re: Brain going crazy with recursive functions

2008-12-07 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: > I'm trying to solve the 9-tile puzzle using as functional an approach > as possible. I've recently finished reading SICP and am deliberately > avoiding easy python-isms for the more convoluted scheme/functional > methods. The following function is trivial to do with f

Re: Brain going crazy with recursive functions

2008-12-07 Thread James Stroud
James Stroud wrote: def linear_search(array, truth_func, loc=(0,0)): idx1, idx2 = loc if idx1 >= len(array): return None if idx2 >= len(array[idx1]): return linear_search(array, truth_func, (idx1+1, 0)) value = array[idx1][idx2] tf = truth_func(value) if tf: return loc e

Re: Brain going crazy with recursive functions

2008-12-07 Thread James Stroud
[EMAIL PROTECTED] wrote: I'm trying to solve the 9-tile puzzle using as functional an approach as possible. I've recently finished reading SICP and am deliberately avoiding easy python-isms for the more convoluted scheme/functional methods. The following function is trivial to do with for loops

Brain going crazy with recursive functions

2008-12-06 Thread 5lvqbwl02
I'm trying to solve the 9-tile puzzle using as functional an approach as possible. I've recently finished reading SICP and am deliberately avoiding easy python-isms for the more convoluted scheme/functional methods. The following function is trivial to do with for loops and directly accessing arr

Brain going crazy with recursive functions

2008-12-06 Thread 5lvqbwl02
I'm trying to solve the 9-tile puzzle using as functional an approach as possible. I've recently finished reading SICP and am deliberately avoiding easy python-isms for the more convoluted scheme/functional methods. The following function is trivial to do with for loops and directly accessing arr