The moose likes Programming Diversions and the fly likes refactoring problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Reply Bookmark "refactoring problem" Watch "refactoring problem" New topic
Author

refactoring problem

Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 754
Simplify:
(x - a) * (x - b) * (x - c) * ... * (x - z)


Author, Agile Java, Essential Java Style. Agile in a Flash. Contributor, Clean Code.
Ken Smart
Greenhorn

Joined: Feb 11, 2004
Posts: 25
0?
because (x-x) is multiplied.
Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 754
correct! Good spot; you got it, but you'd be surprised at the number of people who don't.
-Jeff-
Ken Smart
Greenhorn

Joined: Feb 11, 2004
Posts: 25
thanks, now can i get a free copy of your book?
nice question! i almost prepare to solve it with brutal force, then i find out the trick.
Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 754
hmm, copy of book... Sure, go to http://groups.yahoo.com/group/testDrivenJava and sign up, I'll approve you, and you can download the PDFs. You'll have to print 'em yourself though.
Let me know how many people you stump with the puzzle.
-Jeff-
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Smart by name
smart by nature
Ken Smart
Greenhorn

Joined: Feb 11, 2004
Posts: 25
Thank you very much, Jeff.
I will try the puzzle on as many people as I can. and I will keep you updated.
In fact, i was wondering if the presidential election should have something like this
Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 754
Originally posted by Ken Smart:
Thank you very much, Jeff.
I will try the puzzle on as many people as I can. and I will keep you updated.
In fact, i was wondering if the presidential election should have something like this


Either that or pistols at ten paces...
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1863
just little out of track...
US current president would simplify to,
"this surely seems to be a formule that can be used to produce WMD and we are considering this with extreme delicacy"
Regards
Maulin


1. Have fun @ http://faq.javaranch.com/java/JavaRaq
2. Looking for simple infix2postfix conversion and postfix evaluation package? Click here
 
 
subject: refactoring problem
 
Threads others viewed
WA #1.....word association
Trying out smilies
JDeveloper exam..
how to config Tomcat on windows NT
x
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com