Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
?
lecture-code
Commits
c4bb533e
Commit
c4bb533e
authored
5 months ago
by
?
Browse files
Options
Download
Email Patches
Plain Diff
Update AnimalGame.java. Doing diagnostic 17.
parent
16b893fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
16/AnimalGame.java
+12
-0
16/AnimalGame.java
with
12 additions
and
0 deletions
+12
-0
16/AnimalGame.java
View file @
c4bb533e
...
...
@@ -25,7 +25,19 @@ def play_until_exit():
again = False
*/
void
play_until_exit
()
{
Scanner
scanner
=
new
Scanner
(
System
.
in
)
boolean
again
=
true
;
while
(
again
)
{
play_animal_game
();
System
.
out
.
print
(
"Would you like to play again (y/n)?"
)
String
input
=
scanner
.
nextLine
()
if
(
input
.
toLowerCase
().
startsWith
(
"n"
))
{
System
.
out
.
println
(
"Goodbye!"
);
again
=
false
}
}
scanner
.
close
()
}
double
play_5_times
()
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment