-
Notifications
You must be signed in to change notification settings - Fork 253
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] Step2 - Reimos7 #1003
base: ss_20_Reimos7
Are you sure you want to change the base?
[Round1] Step2 - Reimos7 #1003
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,25 @@ | |
|
||
import Foundation | ||
|
||
print("Hello, World!") | ||
var empty = " " | ||
|
||
func iceCream(size: Int){ | ||
for _ in 1...size { | ||
for _ in 1...10 { | ||
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. 1...10은 무엇을 의미하나요? |
||
print("*", terminator: "") | ||
} | ||
print("") | ||
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. 해당 print는 개행을 위해 호출한 건가요~? |
||
} | ||
} | ||
|
||
func iceCreamStick(size: 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...size { | ||
print("\(empty) | | ") | ||
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. empty 변수를 넣은 이유가 궁금합니다!
|
||
} | ||
print("") | ||
} | ||
|
||
iceCream(size: 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. 사이즈가 높이를 의미하는지 너비를 의미하는지 모호합니다! |
||
iceCreamStick(size: 4) | ||
|
||
makePepero(bodylength: 10, bodyStyle: "*", topping: "$", stickLength: 4) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// Untitled.swift | ||
// CodeStarterCamp_Week1 | ||
// | ||
// Created by Reimos on 9/22/24. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
|
||
func makePepero(bodylength: Int, bodyStyle: String, topping: String, stickLength: 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. 함수 안애 또 함수를 구현한 이유가 궁금합니다 🤔(중괄호 띄어쓰기 해주세용!) |
||
|
||
print("<정보>") | ||
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. 함수명은 makePepero인데 정보를 출력하는 기능도 포함되어있네요! |
||
print("길이:" ,bodylength) | ||
print("몸통: \(bodyStyle)") | ||
print("토핑: \(topping)") | ||
print("막대길이: \(stickLength)") | ||
print("") | ||
|
||
|
||
func bodyLength(_ bodylength: 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...bodylength { | ||
for _ in 1...3{ | ||
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문과 띄어쓰기 컨벤션이 다릅니다! 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. 1...3은 무엇을 의미하나요? |
||
print("\(bodyStyle)", terminator: "") | ||
} | ||
print("") | ||
} | ||
} | ||
|
||
func toppingSet(_ topping: 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. 해당 함수는 어떤 기능을 하나요? |
||
|
||
} | ||
|
||
func stick(_ stickLength: 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...stickLength { | ||
print("| |") | ||
} | ||
print("") | ||
} | ||
|
||
bodyLength(bodylength) | ||
stick(stickLength) | ||
|
||
} | ||
|
||
|
||
|
||
|
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.
API 디자인 가이드라인에 함수의 네이밍 앞쪽에는 동사로 표현해주라고 권장하고 있습니다!
학습 기간 중에 꼭 디자인 가이드라인의 네이밍 부분을 정독해보시길 추천드려요 💪
예를 들어 makeIceCreamBody, printIceCreamBody와 같이요.
아래에 스틱을 그릴때는 iceCreamStick이라고 명시되어있는데 이 곳에는 몸통을 표현하고 있지 않아 그 부분도 명확하게 해주면 좋습니다 :)
스위프트의 모든 중괄호는 앞쪽에 띄어쓰기가 됩니다! (아래 함수도 참고해주세요)