Skip to content
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

1주차 미션 / 서버 3조 - 임수빈 #12

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .gradle/7.4/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/7.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/7.4/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified .gradle/file-system.probe
Binary file not shown.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/classes/java/main/ladder/Ladder.class
Binary file not shown.
Binary file modified build/classes/java/main/ladder/Row.class
Binary file not shown.
Binary file modified build/classes/java/test/ladder/LadderTest.class
Binary file not shown.
Binary file removed build/classes/java/test/ladder/RowTest.class
Binary file not shown.
18 changes: 6 additions & 12 deletions build/reports/tests/test/classes/ladder.LadderTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>LadderTest</h1>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">2</div>
<div class="counter">1</div>
<p>tests</p>
</div>
</td>
Expand All @@ -41,7 +41,7 @@ <h1>LadderTest</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.007s</div>
<div class="counter">0.031s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -76,15 +76,9 @@ <h2>Tests</h2>
</tr>
</thead>
<tr>
<td class="success">만들어진 사다리 이상의 사람 예외 처리</td>
<td class="success">nthOfPersonValidate()</td>
<td class="success">0.001s</td>
<td class="success">passed</td>
</tr>
<tr>
<td class="success">1 -1 0 0 / 0 1 -1 0 / 1 -1 0 0</td>
<td class="success">threeRowTwoColWithLine()</td>
<td class="success">0.006s</td>
<td class="success">사다리게임</td>
<td class="success">run()</td>
<td class="success">0.031s</td>
<td class="success">passed</td>
</tr>
</table>
Expand All @@ -97,7 +91,7 @@ <h2>Tests</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 7.4</a> at 2023. 3. 10. 오후 2:19:09</p>
<a href="http://www.gradle.org">Gradle 7.4</a> at 2023. 3. 24. 오후 6:44:33</p>
</div>
</div>
</body>
Expand Down
152 changes: 0 additions & 152 deletions build/reports/tests/test/classes/ladder.RowTest.html

This file was deleted.

24 changes: 7 additions & 17 deletions build/reports/tests/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1>Test Summary</h1>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">12</div>
<div class="counter">1</div>
<p>tests</p>
</div>
</td>
Expand All @@ -38,7 +38,7 @@ <h1>Test Summary</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.007s</div>
<div class="counter">0.031s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -82,10 +82,10 @@ <h2>Packages</h2>
<td class="success">
<a href="packages/ladder.html">ladder</a>
</td>
<td>12</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.007s</td>
<td>0.031s</td>
<td class="success">100%</td>
</tr>
</tbody>
Expand All @@ -109,20 +109,10 @@ <h2>Classes</h2>
<td class="success">
<a href="classes/ladder.LadderTest.html">ladder.LadderTest</a>
</td>
<td>2</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.007s</td>
<td class="success">100%</td>
</tr>
<tr>
<td class="success">
<a href="classes/ladder.RowTest.html">ladder.RowTest</a>
</td>
<td>10</td>
<td>0</td>
<td>0</td>
<td>0s</td>
<td>0.031s</td>
<td class="success">100%</td>
</tr>
</tbody>
Expand All @@ -136,7 +126,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 7.4</a> at 2023. 3. 10. 오후 2:19:09</p>
<a href="http://www.gradle.org">Gradle 7.4</a> at 2023. 3. 24. 오후 6:44:33</p>
</div>
</div>
</body>
Expand Down
20 changes: 5 additions & 15 deletions build/reports/tests/test/packages/ladder.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>Package ladder</h1>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">12</div>
<div class="counter">1</div>
<p>tests</p>
</div>
</td>
Expand All @@ -40,7 +40,7 @@ <h1>Package ladder</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.007s</div>
<div class="counter">0.031s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -80,20 +80,10 @@ <h2>Classes</h2>
<td class="success">
<a href="../classes/ladder.LadderTest.html">LadderTest</a>
</td>
<td>2</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.007s</td>
<td class="success">100%</td>
</tr>
<tr>
<td class="success">
<a href="../classes/ladder.RowTest.html">RowTest</a>
</td>
<td>10</td>
<td>0</td>
<td>0</td>
<td>0s</td>
<td>0.031s</td>
<td class="success">100%</td>
</tr>
</table>
Expand All @@ -106,7 +96,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 7.4</a> at 2023. 3. 10. 오후 2:19:09</p>
<a href="http://www.gradle.org">Gradle 7.4</a> at 2023. 3. 24. 오후 6:44:33</p>
</div>
</div>
</body>
Expand Down
5 changes: 2 additions & 3 deletions build/test-results/test/TEST-ladder.LadderTest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="ladder.LadderTest" tests="2" skipped="0" failures="0" errors="0" timestamp="2023-03-10T05:19:09" hostname="gimjeong-uui-MacBookAir.local" time="0.007">
<testsuite name="ladder.LadderTest" tests="1" skipped="0" failures="0" errors="0" timestamp="2023-03-24T09:44:33" hostname="imsubin-ui-MacBookAir.local" time="0.031">
<properties/>
<testcase name="1 -1 0 0 / 0 1 -1 0 / 1 -1 0 0" classname="ladder.LadderTest" time="0.006"/>
<testcase name="만들어진 사다리 이상의 사람 예외 처리" classname="ladder.LadderTest" time="0.001"/>
<testcase name="사다리게임" classname="ladder.LadderTest" time="0.031"/>
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
16 changes: 0 additions & 16 deletions build/test-results/test/TEST-ladder.RowTest.xml

This file was deleted.

Binary file modified build/test-results/test/binary/results.bin
Binary file not shown.
Binary file modified build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
Binary file modified build/tmp/compileTestJava/previous-compilation-data.bin
Binary file not shown.
34 changes: 31 additions & 3 deletions src/main/java/ladder/Ladder.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,38 @@

public class Ladder {

private final int[][] rows;
private final Row[] rows;

public Ladder(int row, int numberOfPerson) {
rows = new int[row][numberOfPerson];
validateRow(row);
rows = new Row[row+1];
for (int i=1; i<=row; i++) {
rows[i] = new Row(numberOfPerson);
}
}

}
public void drawLine(int x, int y) {
validatePositionX(x);
rows[x].drawLine(y);
}

public int run(int selection) {
for (int i=1; i<rows.length; i++) {
selection = rows[i].getSelection(selection);
}

return selection;
}

private void validateRow(int row) {
if (row < 1) {
throw new IllegalArgumentException("높이가 1보다 작은 수입니다.");
}
}

private void validatePositionX(int x) {
if ((x <= 0) || (x >= rows.length)) {
throw new IllegalArgumentException("라인을 만들 행이 사다리 높이의 범위 안에 있어야 합니다.");
}
}
}
Loading