Repository navigation
submit coordinate step1 1st #66
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package coordinate; | ||
|
|
||
| import java.util.ArrayList; | ||
|
|
||
| public class CoordinateLine { | ||
| private ArrayList<Integer> list = new ArrayList<>(); | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package coordinate; | ||
|
|
||
|
|
||
| public class CoordinateMain { | ||
| public static void main(String[] args) { | ||
| PrintView.drawVertical(); | ||
| PrintView.drawRow(); | ||
| PrintView.rowNumber(); | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| package coordinate; | ||
|
|
||
| public class PrintView { | ||
| private static final String VERTICAL = "│"; | ||
| private static final String ZERO_POINT = "┼"; | ||
| private static final String ROW = "───"; | ||
| private static final String BLANK = " "; //1칸 | ||
| private static final String BLANK_TWO = " "; | ||
| private static final String BLANK_FOUR = " "; | ||
| private static final int AXIS_MAX = 24; | ||
|
|
||
|
|
||
| public static void drawVertical() { | ||
| for (int i = AXIS_MAX; i > 0; i--) { | ||
| if (i % 2 == 1) { | ||
| System.out.print(BLANK_TWO); | ||
| System.out.println(VERTICAL); | ||
| continue; | ||
| } | ||
| if (i < 10) | ||
| System.out.print(BLANK); | ||
| System.out.print(i); | ||
| System.out.println(VERTICAL); | ||
| } | ||
| } | ||
|
|
||
| public static void drawRow() { | ||
| System.out.print(BLANK_TWO); | ||
| System.out.print(ZERO_POINT); | ||
| for (int i = 0; i < AXIS_MAX-1; i++) { | ||
| System.out.print(ROW); | ||
| } | ||
| System.out.println(); | ||
| } | ||
|
|
||
| public static void rowNumber() { | ||
| System.out.print(BLANK_TWO); | ||
| System.out.print("0"); | ||
| for (int i = 1; i <= AXIS_MAX; i++) { | ||
| if (i % 2 == 0) { | ||
| System.out.print(BLANK_FOUR); | ||
| System.out.print(i); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
|
|
||
| import org.junit.Test; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThat; | ||
|
|
||
| public class ladderTest { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 클래스 이름은 대문자로 시작 |
||
| public double calcaulator(int x1,int y1, int x2, int y2){ | ||
| int xLength = (int)Math.pow(x1-x2,2); | ||
| int yLength = (int)Math.pow(y1-y2,2); | ||
| return Math.sqrt(xLength+yLength); | ||
| } | ||
|
|
||
| /* 거리계산하는 로직 */ | ||
| @Test | ||
| public void calculator(){ | ||
| double length = calcaulator(1,2,1,3); | ||
| assertThat(length).isEqualTo(2); | ||
| } | ||
|
|
||
| /* 숫자 추출하는 로직 */ | ||
| @Test | ||
| public void extractNumTest(){ | ||
| String input = "(1,1)-(1,2)"; | ||
| String[] splited = input.split("(|,|)|-"); | ||
|
|
||
| assertThat(splited[4]).isEqualTo("2"); | ||
| } | ||
| /**/ | ||
| } | ||
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.
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.
들여쓰기 convention에 맞지 않음.