#What can be improved with my code

14 messages · Page 1 of 1 (latest)

worthy veldt
lean joltBOT
#

This post has been reserved for your question.

Hey @worthy veldt! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

lean joltBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

cyan salmon
#

use printfs instead of those concatenations

#

use println() rather than println(" ") to print an empty line

#

fix your indents

#

don't create multiple scanners for every action, use just one

#

use double rather than Double

#

consider removing unnecessary parens

past pumice
#

this can be moved to a separatre method
try {
Thread.sleep(3000);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}

#

the whole method can be split into several methods for easier readability:
intro
battle
scores

frank vessel
#

also is there any reason to flush the std output stream.

#

you could use a String array and a loop for this to drastically decrease your code.