-
Notifications
You must be signed in to change notification settings - Fork 0
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
Errors fixed #3
Errors fixed #3
Conversation
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.
Mindent jonak talaltam.
@@ -14,6 +14,7 @@ public class TorpedoStore { | |||
|
|||
private int torpedoCount = 0; | |||
|
|||
private Random generator = new Random(); |
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.
Ez a random nem jelent kriptografiai kockazatot, mert csak jatektechnikai vonatkozasai vannak, nincs koze szemelyes adatokhoz.
@@ -30,18 +31,18 @@ public TorpedoStore(int numberOfTorpedos){ | |||
|
|||
public boolean fire(int numberOfTorpedos){ | |||
if(numberOfTorpedos < 1 || numberOfTorpedos > this.torpedoCount){ | |||
new IllegalArgumentException("numberOfTorpedos"); | |||
throw new IllegalArgumentException("numberOfTorpedos"); |
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.
Ez az elvart viselkedes megfelelo.
double r = generator.nextDouble(); | ||
|
||
if (r >= FAILURE_RATE) { | ||
// successful firing | ||
this.torpedoCount =- numberOfTorpedos; | ||
this.torpedoCount -= numberOfTorpedos; |
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.
Megfelelo javitas, ez az elvart viselkedes.
A valtoztatasok megfeleloek, a random nem tartalmaz security risket. |
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.
Ez nem okoz gondot, a komment megfelelo.
Quality Gate passedIssues Measures |
I solved all three errors in 3 commits. Please review it to be sure.