Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Improve My FaceBook Scramble Solver

by Limbic~Region (Chancellor)
on Aug 18, 2009 at 20:03 UTC ( #789578=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Improve My FaceBook Scramble Solver
in thread Improve My FaceBook Scramble Solver

tilly,
I'm puzzled by your comment that DFS iteratively is ugly.

Which was made in reference to my comment "I have done a DFS iteratively and it is ugly." That should probably have been two distinct statements. "What I have done is a DFS." and "I think it is ugly compared to the recursive alternatives". In my opinion, the situation is reversed in a BFS (recursive being the ugly one). I go on to indicate that my motivation was producing results rather than maintainable code. Perhaps it is just personal aesthetics but I don't find while (@work) { ... } very beautiful. It is just more natural to me.

I'd also recommend that you put some work pushing past your recursion block.

I agree and have dabbled with it off and on. I don't have any problem understanding other people's recursive routines but producing them myself doesn't seem natural. I recently wrote a recursive sub to find the root node of child in a tree by following the parent all the way to the top. Believe it or not, it was harder for me to write something that simple than it was for me to think about the iterative form. Again, thank you for the feedback and encouragement. I will continue to plug away at it.

Cheers - L~R


Comment on Re^4: Improve My FaceBook Scramble Solver
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://789578]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-08-29 17:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (283 votes), past polls