Skip to content

Commit

Permalink
step3 first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeseoyoung authored and jeseoyoung committed Sep 17, 2024
1 parent 9077250 commit c322801
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
3 changes: 1 addition & 2 deletions CodeStarterCamp_Week1/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

import Foundation

drawIceCreamBody()
drawIceCreamBar()
drawPepero(stickLenth: 12, bodyDecoration: " ***", bodyLenth: 4)
30 changes: 30 additions & 0 deletions CodeStarterCamp_Week1/step3.swift
Original file line number Diff line number Diff line change
@@ -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)
}
}

Binary file added ss_20_sy_week1-step3_flow_chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c322801

Please sign in to comment.