I am doing a java course through an online university.

I started the Tutor marked exercises today. A simple bit of java code. First they have you output a bunch of asterisks.
Then they have you output a different assortment of asterisks. To quote the directive

"Edit the program stars so that it prints five asterisks centered on the fourth line, three asterisks centered on the fifth line, and one asterisk cventered on the sixth line" Compile and run your program.

After giving the problem considerable thought, I started looking into importing some Java curses libraries, so that I could pull the number of columns from the active console display, divide the number in half, and either place the cursor in the right place or pad my strings with whitespace to achieve the same effect.

Which led me to the grim realization that I had just managed to turn a Java exercise of "Hello World" into bloatware.

So I did the right thing. I commented in that I was making assumptions about the number of columns, and then commented in a suggestion as to how to make the display always work using curses libraries.

But it still remains - I managed to bloat "Hello world"
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
Account name:
If you don't have an account you can create one now.
HTML doesn't work in the subject.


Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.


luckytroll: Wearing my old fave hat (Default)

Most Popular Tags

Powered by Dreamwidth Studios

Style Credit

Expand Cut Tags

No cut tags