-
Notifications
You must be signed in to change notification settings - Fork 250
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
[Round1] Step3 - tomchoi95 #999
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,19 @@ | |
|
||
import Foundation | ||
|
||
print("Hello, World!") | ||
func iceCreamBody() { | ||
for _ in 1...8 { | ||
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. 와일드카드패턴까지 사용하여 for문을 잘 활용해주셨네요! 컨벤션도 좋아요 👍 |
||
print("***********") | ||
} | ||
} | ||
|
||
func iceCreamBar() { | ||
for _ in 1...4 { | ||
print(" | |") | ||
} | ||
} | ||
|
||
iceCreamBody() | ||
iceCreamBar() | ||
|
||
makePepero(bodyLength: 3 ,body: "|0|", topping: " ",barLength: 3) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// order.swift | ||
// CodeStarterCamp_Week1 | ||
// | ||
// Created by 최범수 on 2024-09-17. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
func makeWholeBody(_ ParaBodyLength : Int, _ ParaBody : String, _ ParaTopping : String) { | ||
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. Para가 무엇을 뜻하는지 궁금합니다! 언더바를 통해 생략해주시면 사용하는 곳에서 해당 매개변수에 어떤 것이 들어와야하는지 모호하기에 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. parameter의 축약으로서 네이밍시 매개변수인걸 안잊으려 앞에 para를 붙였습니다. |
||
for _ in 1...ParaBodyLength { | ||
print(ParaTopping + ParaBody + ParaTopping) | ||
} | ||
} | ||
|
||
func makeBar(_ ParaBarLength : Int) { | ||
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. 이 함수의 네이밍도 makePeperoBar(length: Int) 형태이면 좋을 것 같습니다! 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. 참고 하겠습니다! |
||
for _ in 1...ParaBarLength { | ||
print(" | |") | ||
} | ||
} | ||
|
||
func information(_ ParaBodyLength : Int, _ ParaBody : String , _ ParaTopping : String , _ ParaBarLength : Int) { | ||
print("<정보>\n길이 : \(ParaBodyLength)\n몸통 : \(ParaBody)\n토핑 : \(ParaTopping)\n막대길이 : \(ParaBarLength)") | ||
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. 정보 출력 후 개행이 되지않아 결과물이 조금 보기 힘든 부분이 있는 것 같아요! |
||
} | ||
|
||
func makePepero(bodyLength ParaBodyLength : Int, body ParaBody : String , topping ParaTopping : String , barLength ParaBarLength : Int) { | ||
information(ParaBodyLength, ParaBody, ParaTopping, ParaBarLength) | ||
makeWholeBody(ParaBodyLength, ParaBody, ParaTopping) | ||
makeBar(ParaBarLength) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<mxfile host="Electron" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.8 Chrome/128.0.6613.36 Electron/32.0.1 Safari/537.36" version="24.7.8"> | ||
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1"> | ||
<mxGraphModel dx="984" dy="747" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> | ||
<root> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" /> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" /> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-2" value="" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="WIyWlLk6GJQsqaUBKTNV-6" edge="1"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint x="220" y="120" as="sourcePoint" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-4" value="Yes" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" target="WIyWlLk6GJQsqaUBKTNV-10" edge="1"> | ||
<mxGeometry y="20" relative="1" as="geometry"> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-5" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" target="WIyWlLk6GJQsqaUBKTNV-7" edge="1"> | ||
<mxGeometry y="10" relative="1" as="geometry"> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-6" value="Does icecream part exist?" style="rhombus;whiteSpace=wrap;html=1;shadow=0;fontFamily=Helvetica;fontSize=12;align=center;strokeWidth=1;spacing=6;spacingTop=-4;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1"> | ||
<mxGeometry x="170" y="170" width="100" height="80" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-7" value="Recall icecream part" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1"> | ||
<mxGeometry x="320" y="190" width="120" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-8" value="No" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-10" target="WIyWlLk6GJQsqaUBKTNV-11" edge="1"> | ||
<mxGeometry x="0.3333" y="20" relative="1" as="geometry"> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-9" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-10" target="WIyWlLk6GJQsqaUBKTNV-12" edge="1"> | ||
<mxGeometry y="10" relative="1" as="geometry"> | ||
<mxPoint as="offset" /> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-10" value="Does bar part exist" style="rhombus;whiteSpace=wrap;html=1;shadow=0;fontFamily=Helvetica;fontSize=12;align=center;strokeWidth=1;spacing=6;spacingTop=-4;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1"> | ||
<mxGeometry x="170" y="290" width="100" height="80" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="7pEJS6Be8Euky6LiwNCo-1" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-11" target="7pEJS6Be8Euky6LiwNCo-0"> | ||
<mxGeometry relative="1" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-11" value="Recall bar part" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1"> | ||
<mxGeometry x="160" y="430" width="120" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-12" value="You've made it" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1"> | ||
<mxGeometry x="320" y="310" width="120" height="40" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="7pEJS6Be8Euky6LiwNCo-0" value="Whole Ice cream" style="ellipse;whiteSpace=wrap;html=1;rounded=1;glass=0;strokeWidth=1;shadow=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1"> | ||
<mxGeometry x="180" y="530" width="80" height="80" as="geometry" /> | ||
</mxCell> | ||
<mxCell id="7pEJS6Be8Euky6LiwNCo-2" value="Make Ice cream" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1"> | ||
<mxGeometry x="160" y="40" width="120" height="80" as="geometry" /> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
</mxfile> |
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.
함수앞은 항상 동사로 시작합니다!
makeIceCreamBody
createIceCreamBody
와 같이요 :)
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.
감사합니다!