This is the Beer Song code. It has been fixed by forcing prints with beerNum > 1, beerNum == 1, and beerNum == 0. This way, it'll print "bottle," not "bottles." When run, it works as it should, obviously.
This is the PhraseOMatic code. The word lists are actually much longer, but they're cut off. It's very basic, man. It gives wonderful responses like: "What we need is a critical-path targeted vision" and "What we need is a 30,000 foot centric vision."
Java is a little different than Python. It uses ";" at the end of each line, and it's generally more "complicated." It uses a more complicated class system, and the "static/void/public" stuff that Python doesn't use. Python's "print" is less confusing that Java's "System.out.lnprint()." Both use basic things like strings, and integers, but Java makes it easier to mess up by making you write "String" (capitalized) while Python uses "str." Lists are also much easier to use in Python.
No comments:
Post a Comment