Search |
||
How NetBeans helped in 100th day of school celebration ?Posted by arungupta on February 3, 2008 at 5:13 PM PST
My friend's daughter got a family assignment from school to commemorate 100th day in school. If each letter in the English alphabet is assigned a weight corresponding to it's position (e.g. "a" is 1, "b" is 2, ... "z" is 26) then she was supposed to collect 10 words whose letters sum total to 100. They spent last 1.5 days and found only 3 words and were discussing the problem at the lunch table earlier today. Here is a small piece of code that I wrote to help them out:
This application was easily created using
NetBeans 6. And then I copy/pasted articles from my favorite news sites in a
file, passed it as command-line argument by right-clicking the project,
selecting " Hit F6, and voila got more than 10 words :) Technorati: netbeans school assignment »
Related Topics >>
Community Comments
Comments are listed in date ascending order (oldest first)
Submitted by arungupta on Mon, 2008-02-04 07:04.
You can write this code any IDE or event notepad/vi but I used NetBeans. Quick code completion and suggestions reduced the time to author this code.
Submitted by kirillcool on Mon, 2008-02-04 09:47.
Quick code completion and suggestions can be found in any other IDE of matching strength (which would be at least Eclipse, IDEA and JDeveloper).
Submitted by aberrant on Tue, 2008-02-05 09:18.
You could also take the entire aspell dictionary and search that.
http://aspell.net/win32/ Also I think you could eliminate the binary search,by casting a char to an int. int base = (int)'a' - 1; System.out.println('a' - base); System.out.println('b' - base); System.out.println('c' - base); ...output... 1 2 3 Sure it's horribly wrong for internationalization but you are searching only English worlds. I would suspect the casting and subtraction would be faster then the binary search. It's a very cool little problem. |
||
|
|