File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programming Diversions and the fly likes Created application for the change pattern AAAA AAAB AABA AABB ect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Created application for the change pattern AAAA AAAB AABA AABB ect" Watch "Created application for the change pattern AAAA AAAB AABA AABB ect" New topic
Author

Created application for the change pattern AAAA AAAB AABA AABB ect

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 556
Hi hope this is the correct thread.

Created an application for the changing a pattern given a pattern AAAA and a char B
Will end up with BBBB following making one change at a time i.e AAAB AABA AABB ABAA.

It works but I guess there is a faster or a recursive way of doing it.

Anyway just review this. This is not for college or unie. As we move more and more towards framwork I want to try and keep my basic coding skills as sharp as I can.




Main application


The object container

fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10907
    
  12

isn't this really just counting in binary? let 0 = A and 1 = B.

0000
0001
0010
0011
0100
0101
0110
0111
etc

you could just count from 0 to 15, use a mask to check each bit, and print the associated character.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Created application for the change pattern AAAA AAAB AABA AABB ect
 
Similar Threads
Weird unicode translation problem
String optimization weirdness
How do I pass a frame into another class?
Quick String to <char> Array Conversion
Implementation of SLR parser