-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brittany Planet Express in Python and Java #3
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,73 @@ | |||
class PlanetExpress: | |||
def __init__(self): | |||
self.thirst = 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might recommend using some constants for these 50 and the 4 values
For Java, most of the time you don't want to check in the |
Scanner reader = new Scanner(System.in); // Reading from System.in | ||
System.out.println("Type drink, deliver, steal, eat, or account to continue playing."); | ||
String input = reader.next(); | ||
while (!input.toLowerCase().equals("drink") && !input.toLowerCase().equals("deliver") && !input.toLowerCase().equals("steal") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like you should be doing the lower case operation only once rather than in each of these equivalence checks
Planet Express exercise completed in both Python and Java.