When we give unexpected input, program get terminated. I think to handle these exception, program should show error message then ask for input again.
I would like to contribute to this by handling these exception. If you want these exception to be handled in some other way, please let me know.
When I try to run Main.java in tut5 . I am getting many errors. Main.java:77: error: 'else' without 'if' else{ ^ Main.java:86: error: class, interface, or enum expected private static int takeIntInput() { ^ Main.java:89: error: class, interface, or enum expected try { ^ Main.java:91: error: class, interface, or enum expected } catch (Exception ne) { ^ Main.java:93: error: class, interface, or enum expected } ^ 5 errors
Hi! โ
In tut5/Main.java while we are checking if a target has been hit or not, we need not iterate over all the previous hits to check, rather keep a HashMap / HashSet for the same in order to achieve a better time complexity!
When we create multiple user in program it don't ask for username. It is because you used nextInt in tut7/Game.java and tut7/Menu.java, while taking integer input. I think by taking input as string and parsing it using Integer.parseInt() function to int will resolve this.
While running tut-7 i found a bug that it hero hp can go negative. I think this should not be less than zero as mentioned in tut-7 pdf.
You choose to attack
Your Hp: 60/100Monsters Hp :180/200
Monster attack!
Your Hp: 35/100Monsters Hp :180/200
Choose move:
Attack
Defense
3)Special Attack
3
Special power activated
Performing special attack
Your Hp: 35/100Monsters Hp :180/200
Monster attack!
Your Hp: -4/100Monsters Hp :180/200
You have died start over
You are at location 10 Choose path:
When i run tut-6 it is really difficult to understand what to enter because it is not printing what we have to enter. Also sometimes we need to enter 2 and 3 inputs together so it is really confusing what we have to enter.