• Post Reply Bookmark Topic Watch Topic
  • New Topic

Combinations of letters to form symbols  RSS feed

 
Patrick Perrin Smith
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The topic might have sounded a little vague, so let me explain:

My professor is a man who enjoys making his students form large, but often simple symbols with smaller letters.

That might not have clarified much, so let me demonstrate:



Or...



Or lastly...



By this time, I'm pretty sure you understand the point.

My problem is, that I've always been bad at figuring out the logic behind these.

I can kinda' see it (somewhat) in my head though... I'd need a double for-loop which depend on the sizes, one that monitors the spaces and one that monitors the symbols, with some conditionals in there.

Problem is, I can never seem to figure these problems out.

If you were to teach someone how to make symbols like this, using letters, in Java. How'd you do it?

What would you tell them? How would you instruct?
 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first step would be to perform the task by hand. Take a piece of paper and form the shapes yourself. Work out what information you need to know to do it, and write out the steps in natural language. When you get these steps written down we can help you turn it into Java.
 
Tyson Lindner
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Patrick Perrin Smith wrote:
If you were to teach someone how to make symbols like this, using letters, in Java. How'd you do it?


Seems like a pretty awful assignment. Its more of an art problem than either a logic problem or a java syntax problem. Roughly you have to go through every letter and create your own string output to get a symbol. Generating the code that matches letters to symbols should be an easy task compared to creating all the symbols. There really isn't a good way to generate the symbols automatically if that's what your asking. You have to "design" them.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it is a standard assignment. It is a useful skill to be able to write loops which printfor Java. It does become pretty tedious if you have a lot to print. You would want LetterA LetterB LetterC etc classes.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Patrick Perrin Smith wrote:That might not have clarified much, so let me demonstrate:

Just off the top of my head, I noticed that "V" is a different height from the others. It also seems more logical to me that it would benot "filled in".

However, I tend to agree with Tyson. I'm not sure how much you can learn from an exercise like this - except maybe a bit of String manipulation.

Winston
 
Dave Tolls
Ranch Foreman
Posts: 3061
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:No, it is a standard assignment. It is a useful skill to be able to write loops which printfor Java. It does become pretty tedious if you have a lot to print. You would want LetterA LetterB LetterC etc classes.


I'd do an enum and simply provide a String representation...
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:I'd do an enum and simply provide a String representation...

I like the enum idea; but you'd probably still have to have something to convert a character to the right one.

Damn programming...

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!