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

[Round1] Step3 - tomchoi95 #999

Merged
merged 2 commits into from
Sep 25, 2024
Merged
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
15 changes: 13 additions & 2 deletions CodeStarterCamp_Week1.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
34811DAF274B938F00A1E994 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34811DAE274B938F00A1E994 /* main.swift */; };
B355E57F2C99525700F2AB37 /* order.swift in Sources */ = {isa = PBXBuildFile; fileRef = B355E57E2C99525700F2AB37 /* order.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -25,6 +26,7 @@
/* Begin PBXFileReference section */
34811DAB274B938F00A1E994 /* CodeStarterCamp_Week1 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CodeStarterCamp_Week1; sourceTree = BUILT_PRODUCTS_DIR; };
34811DAE274B938F00A1E994 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
B355E57E2C99525700F2AB37 /* order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = order.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -58,6 +60,7 @@
isa = PBXGroup;
children = (
34811DAE274B938F00A1E994 /* main.swift */,
B355E57E2C99525700F2AB37 /* order.swift */,
);
path = CodeStarterCamp_Week1;
sourceTree = "<group>";
Expand Down Expand Up @@ -88,8 +91,9 @@
34811DA3274B938F00A1E994 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 1250;
LastUpgradeCheck = 1540;
TargetAttributes = {
34811DAA274B938F00A1E994 = {
CreatedOnToolsVersion = 12.5.1;
Expand Down Expand Up @@ -119,6 +123,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B355E57F2C99525700F2AB37 /* order.swift in Sources */,
34811DAF274B938F00A1E994 /* main.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -160,9 +165,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -221,9 +228,11 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -245,6 +254,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
Expand All @@ -254,6 +264,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
Expand Down
16 changes: 15 additions & 1 deletion CodeStarterCamp_Week1/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,19 @@

import Foundation

print("Hello, World!")
func iceCreamBody() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수앞은 항상 동사로 시작합니다!
makeIceCreamBody
createIceCreamBody
와 같이요 :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다!

for _ in 1...8 {

Choose a reason for hiding this comment

The 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)
31 changes: 31 additions & 0 deletions CodeStarterCamp_Week1/order.swift
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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Para가 무엇을 뜻하는지 궁금합니다!
네이밍 또한 makePeperoBody 와 같이 해주시고 매개변수에는 length, bodyType, topping 등으로 해주시면 좋을 것 같아요~
매개변수에 중복되는 단어가 너무 발생합니다!

언더바를 통해 생략해주시면 사용하는 곳에서 해당 매개변수에 어떤 것이 들어와야하는지 모호하기에
생략을 하지않는 것이 좋을 것 같아요 🤔

Copy link
Author

Choose a reason for hiding this comment

The 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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 함수의 네이밍도 makePeperoBar(length: Int) 형태이면 좋을 것 같습니다!

Copy link
Author

Choose a reason for hiding this comment

The 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)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정보 출력 후 개행이 되지않아 결과물이 조금 보기 힘든 부분이 있는 것 같아요!
해당 프린트 문 끝에 \n을 붙여주면 개행이 됩니다!

}

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)
}
59 changes: 59 additions & 0 deletions Ice_cream.drawio
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&#39;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>
Loading