• Post Reply Bookmark Topic Watch Topic
  • New Topic

beersong  RSS feed

 
Rui Sousa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
need a little help here.

its the beersong code.
in my output it starts to count from 59 down when it shoul start from 99 bottles of beer. got the same code from the book head first java.

here is my code:
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rui Sousa wrote:need a little here.
in my output it starts to count from 59 down. got the same code from the book.

Erm ... we don't expect perfect English here, but we do expect understandable English.

  • You need a little [what] here?
  • What counts down from 59?
  • Got the same code as what? From which book?

  • any trick?

    Any trick for doing what?

    Please TellTheDetails (←click); otherwise, we can't help you.

    Winston
     
    Campbell Ritchie
    Marshal
    Posts: 56536
    172
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Welcome to the Ranch
    I ran your code unchanged and it started from 99. I suspect your command line does not display enough lines when you scroll, and you are only scrolling back to 59. I added code tags, which you should always use, to your code, and you can see how much better it looks Unfortunately that highlights the inconsistent spacing and indentation.
     
    Rui Sousa
    Greenhorn
    Posts: 14
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Campbell Ritchie wrote:Welcome to the Ranch
    I ran your code unchanged and it started from 99. I suspect your command line does not display enough lines when you scroll, and you are only scrolling back to 59. I added code tags, which you should always use, to your code, and you can see how much better it looks Unfortunately that highlights the inconsistent spacing and indentation.



    ok man thanks, you´re right, that was the problem.

    i´m running it in command prompt, so it might be the problem.
     
    fred rosenberger
    lowercase baba
    Bartender
    Posts: 12563
    49
    Chrome Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    on any open command prompt, right-click on the bar across the top. Select properties. Go to the layout tab. On the "screen buffer size", I put in a height of 9999.

    (I also like to choose the "quick edit" and "insert mode" options on the "Options" tab.)

    This should then let you scroll back and see it all from 99 to 0.

     
    Campbell Ritchie
    Marshal
    Posts: 56536
    172
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You're welcome
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!