• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Created application for the change pattern AAAA AAAB AABA AABB ect

 
Ranch Hand
Posts: 632
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
lowercase baba
Posts: 12751
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!