Organize&Fix: src/Graphwar/ComputerPlayer.java#30
Open
Cmd-GZ wants to merge 5 commits into
Open
Conversation
Integrate many repeative codes and nested codes
…eft corner in y' mode In y' mode, if you send a function that is undefined, such as `log(x)`, `sqrt(x)`, `ln(x)`, at the starting point, instead of exploding at the starting point, the bullet will explode on the top-left corner. I have no idea that what stuff exactly causes it, but it's suprise that I fixed it when I try reorganising the `Function.java` unconsciously. Just like I said, the code in `src/Graphwar/Function.java` is organized to make it more readable, which fixes the bug somehow.
…ter the branch `fix/Function` It's clearly that process(Function/RK4/RK42)Range is unnecessary after abstract them as processRange. So I make peocessRange be a public method and remove process(Function/RK4/RK42)Range. And modify the caller (GameData.jar, ComputerPlayer.java)'s code for the change.
1. Organize ComputerPlayer.java to make it more readable 2. Fix a bug in `run()`, which makes the program mutate the old function angle (functions[i].angle) instead of the new one (newFunctions[i].angle) 3. Remove unused initialize about bestFunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run(), which makes the program mutate the old function angle (functions[i].angle) instead of the new one (newFunctions[i].angle)I don't know if you could accept large-scale changes. So I split them into 3 PRs. Here is the last one. Sorry for bothering you if you don't like it.