生活中的 function 實例練習

Yi Cheng Chiang
Jul 30, 2017 · 1 min read
func 起床(){print(“6點半起床”)print(“賴床”)print(“運動或寫app二選一”)print(“8點刷牙整理儀容”)print(“出門開車”)}func 開車(){print(“打開門”)print(“發動車”,”熱車”,”開窗戶”,”開廣播”)print(“出發”)}func 去公司(){print(“停車”)print(“走進公司的大門打卡”)print(“走到辦公室”)print(“開電腦開始上班等下班”)}func 早上去basf上班(){起床()開車()去公司()}早上去basf上班()

呈現的結果:

6點半起床

賴床

運動或寫app二選一

8點刷牙整理儀容

出門開車

打開門

發動車 熱車 開窗戶 開廣播

出發

停車

走進公司的大門打卡

走到辦公室

開電腦開始上班等下班

    Yi Cheng Chiang

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade