• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Assignment 1-b

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am utterly confused.
The following is a part of my submission for ib -
> //calculate number of complete lines that is possible

(Marilyn deleted code to protect future participants)

- and I got nitpicked as follows -
What happens if the name is just perfectly long enough that you
write exactly 80 characters? ( like "sue", "bill" or "marilyn" )
- that and the fact that when use 'bill' to run the program, it[ the program] inserted an extra line between the lines, made me think that I needed to count the nbr of chars being printed to the screen. This I did and got nitpicked as follows -
Looks like you are depending on something that the operating system
does. The program will be simpler if you don't concern yourself with
squeezing in that last tidbit of optimization. I suggest that instead, you
simply avoid the 80th character and always force a new line at the end of
each line.
- but I did start a new line after every line that was printed -

HElp!!

[This message has been edited by Marilyn deQueiroz (edited April 05, 2001).]
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is that not all consols behave the same way. If you do checking to see if you if you hit the 80th spot exactly and then not have it force a line in that case, it will work on some but maybe not others. Just avoiding the 80th character in the first place is easier and a more elegant solution.
Bill
 
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm...
I want to say how I did it because I am thinking it will be considered a 'cheat'. But I don't want to give anything away...
What a dilemna

------------------
SOURCE CODE should be SURROUNDED by "code" tags.
Click here for an example
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic