• 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

beersong

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
     
    Marshal
    Posts: 79411
    377
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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.
     
    lowercase baba
    Posts: 13089
    67
    Chrome Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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: 79411
    377
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You're welcome
     
    That feels good. Thanks. Here's a tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic