diff --git a/CodeStarterCamp_Week1/main.swift b/CodeStarterCamp_Week1/main.swift index 5878a146..65088686 100644 --- a/CodeStarterCamp_Week1/main.swift +++ b/CodeStarterCamp_Week1/main.swift @@ -8,5 +8,4 @@ import Foundation -drawIceCreamBody() -drawIceCreamBar() +drawPepero(stickLenth: 12, bodyDecoration: " ***", bodyLenth: 4) diff --git a/CodeStarterCamp_Week1/step3.swift b/CodeStarterCamp_Week1/step3.swift new file mode 100644 index 00000000..9176a2e8 --- /dev/null +++ b/CodeStarterCamp_Week1/step3.swift @@ -0,0 +1,30 @@ +// +// step3.swift +// CodeStarterCamp_Week1 +// +// Created by jeseoyoung on 2024/09/14. +// + +import Foundation + +func drawPepero(stickLenth: Int, bodyDecoration: String, topping: String = "", bodyLenth: Int) { + setPeperoBody(bodyLenth: bodyLenth, bodyDecoration: bodyDecoration, topping: topping) + drawPeperoStick(stickLength: stickLenth) +} + +func drawPeperoStick(stickLength: Int) { + for _ in 1...stickLength{ + print(" | |") + } +} + +func drawPeperoBodyAndToppings(bodyDecoration: String, topping: String) { + print(topping, bodyDecoration, topping, separator: "") +} + +func setPeperoBody(bodyLenth: Int, bodyDecoration: String, topping: String) { + for _ in 1...bodyLenth { + drawPeperoBodyAndToppings(bodyDecoration: bodyDecoration, topping: topping) + } +} + diff --git a/ss_20_sy_week1-step3_flow_chart.png b/ss_20_sy_week1-step3_flow_chart.png new file mode 100644 index 00000000..08a5a2be Binary files /dev/null and b/ss_20_sy_week1-step3_flow_chart.png differ