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"
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"
From:
no subject