<font color=#008000> >作者: 吳姿瑩 >更新:2022.09.16 </font>[color=#008000] # Lesson02: 寫程式暖身- Hour of Code ###### tags: `運動科學模擬` `多元選修` `hour of Code` ## :memo:程式語言列表 Wiki資料 https://zh.wikipedia.org/zh-tw/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80%E5%88%97%E8%A1%A8 - <div style="height:10px;">程式語言種類</div> <a href="https://imgur.com/TjR1dGa"><img src="https://i.imgur.com/TjR1dGa.png" title="程式語言種類" /></a> 程式語言有許多種,有電腦語言C++ python、有硬體軟體介面開發的Arduino Labview、更有遊戲視覺化Scratch Minecraft等等,皆是使用到不同的程式語言,其中皆是轉化為電腦語言讓電腦了解人們想執行的動作! 更是新世紀很重要的課題之一。 :::spoiler **學生活動:** 每個人請在google classroom寫下為何選擇這堂課的動機? 想寫程式的動機為何? ::: --- ## :memo:今日主角 Hour of Code Hour of Code: https://hourofcode.com/us/zh 完成今日任務即可獲得證書! <iframe width="560" height="315" src="https://www.youtube.com/embed/nKIu9yen5nc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> 讓我們來看看曾經是NBA暴龍隊的職業籃球運動員 Chris Bosh <iframe width="560" height="315" src="https://www.youtube.com/embed/kx3DxBbweGY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> 再來看看**Steve Jobs**(蘋果的執行長), **Bill Gates**微軟公司的董事長, **Mark Zuckerberg**(Facebook執行長), **Mark Cuban**(企業家兼美國職籃NBA球隊達拉斯獨行俠老闆庫班), **Elon Musk**(SpaceX創始人)談談Coding吧! <iframe width="560" height="315" src="https://www.youtube.com/embed/YPE2dO5sII0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> :::spoiler **學生活動:** 每個人請在google classroom用一句話來描述coding! ::: --- ## :memo:Let's start the one hour of code! class :Robotics with RoboBlocky (grade 5+) 課程名稱:利用RoboBlockly學習機器人原理 https://hourofcode.com/robob 共有12關,以組為單位,發揮小組想法激盪,最快完成之組別將進行加分。 請各位同學打開此連結,進行課堂闖關! https://roboblocky.com/curriculum/hourofcode/robotics/7.php - 畫面介紹 <a href="https://imgur.com/Iw4R4Ds"><img src="https://i.imgur.com/Iw4R4Ds.png" title="source: imgur.com" /></a> - 設定畫布 <a href="https://imgur.com/D7sx834"><img src="https://i.imgur.com/D7sx834.png" title="source: imgur.com" /></a> - 設定機器人 <a href="https://imgur.com/aHL1Yrp"><img src="https://i.imgur.com/aHL1Yrp.png" title="source: imgur.com" /></a> --- 在開始前,小小提醒,過程中可將成果錄製、截圖,放於雲端硬碟中, 期末協作平台的成果,皆能呈現課程中的影片、圖片,豐富自己的學習歷程! 錄製影片: 可按 win + alt + R (停止再按一次即可) 截取圖片: 可按 win + Shift + S(選取所需範圍) <a href="https://imgur.com/WoOVGGA"><img src="https://i.imgur.com/WoOVGGA.png" title="source: imgur.com" /></a> --- ##### 1. Level 1:請畫一個邊長5cm的正方形 <iframe width="560" height="315" src="https://www.youtube.com/embed/-dm30aaFCSI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -使用的icon: 機器人-drivedistance(往前移動距離) <a href="https://imgur.com/W4bBOzd"><img src="https://i.imgur.com/W4bBOzd.png" title="source: imgur.com" /></a> 機器人-turn right/left degrees(向右/左轉角度) <a href="https://imgur.com/JDwXFqj"><img src="https://i.imgur.com/JDwXFqj.png" title="source: imgur.com" /></a> :::spoiler **Solution:** <a href="https://imgur.com/Xkf8hy4"><img src="https://i.imgur.com/Xkf8hy4.png" title="source: imgur.com" /></a> ::: --- ##### 2. Level 2:請畫一個邊長5cm的正方形(使用迴圈) <iframe width="560" height="315" src="https://www.youtube.com/embed/fn5oXoOqQwA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -使用的icon: 迴圈-重複數次執行 <a href="https://imgur.com/kUe6Bjx"><img src="https://i.imgur.com/kUe6Bjx.png" title="source: imgur.com" /></a> :::spoiler **Solution:** <a href="https://imgur.com/0rv2ixJ"><img src="https://i.imgur.com/0rv2ixJ.png" title="source: imgur.com" /></a> ::: --- ##### 3. Level 3:請快速畫一個邊長5cm的正方形(時間5秒內) <iframe width="560" height="315" src="https://www.youtube.com/embed/vv6FCvvp3UU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -使用的icon: 機器人-setspeed(設定速率快慢) <a href="https://imgur.com/szDMOkV"><img src="https://i.imgur.com/szDMOkV.png" title="source: imgur.com" /></a> :::spoiler **Solution:** <a href="https://imgur.com/Sy84lO5"><img src="https://i.imgur.com/Sy84lO5.png" title="source: imgur.com" /></a> ::: --- ##### 4. Level 4:請畫一個邊長5cm的五角形 <iframe width="560" height="315" src="https://www.youtube.com/embed/5myHWQ4BezM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> :::spoiler **Solution:** <a href="https://imgur.com/agDJfFv"><img src="https://i.imgur.com/agDJfFv.png" title="source: imgur.com" /></a> ::: --- ##### 5.Level 5:請畫一個邊長5cm的六角形 <iframe width="560" height="315" src="https://www.youtube.com/embed/jKvXecMaA0Y" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> :::spoiler **Solution:** <a href="https://imgur.com/by6RIV3"><img src="https://i.imgur.com/by6RIV3.png" title="source: imgur.com" /></a> ::: --- ##### 6.Level 6:請畫一個每線段為5cm的星星 <iframe width="560" height="315" src="https://www.youtube.com/embed/3NEKdboNXnc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> :::spoiler **Solution:** <a href="https://imgur.com/2qfZvec"><img src="https://i.imgur.com/2qfZvec.png" title="source: imgur.com" /></a> ::: --- ##### 7.Level 7:請畫一個每線段為2.5cm的五角星星 <iframe width="560" height="315" src="https://www.youtube.com/embed/1uhGmEInu4U" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> :::spoiler **Solution:** <a href="https://imgur.com/Ka8RGUn"><img src="https://i.imgur.com/Ka8RGUn.png" title="source: imgur.com" /></a> ::: --- ##### 8.Level 8:請畫一個箭頭 <iframe width="560" height="315" src="https://www.youtube.com/embed/wQro55xAxrs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -使用的icon: 機器人-drivexy (畫一x,y各為數公分線段) <a href="https://imgur.com/ioyP6z7"><img src="https://i.imgur.com/ioyP6z7.png" title="source: imgur.com" /></a> 機器人-driveto (畫一至x,y位置之線段) <a href="https://imgur.com/JbMKYyX"><img src="https://i.imgur.com/JbMKYyX.png" title="source: imgur.com" /></a> :::spoiler **Solution:** <a href="https://imgur.com/Xrbt5Dr"><img src="https://i.imgur.com/Xrbt5Dr.png" title="source: imgur.com" /></a> ::: --- ##### 9.Level 9:請寫一個英文字母A <iframe width="560" height="315" src="https://www.youtube.com/embed/1Pa5NR7kOJ0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -使用的icon: 機器人-trace on/off(開啟/關閉路徑) <a href="https://imgur.com/W18JptZ"><img src="https://i.imgur.com/W18JptZ.png" title="source: imgur.com" /></a> :::spoiler **Solution:** <a href="https://imgur.com/bTwrA5Z"><img src="https://i.imgur.com/bTwrA5Z.png" title="source: imgur.com" /></a> ::: --- ##### 10.Level 10:畫一個黑色周長、半徑為5公分的圓 <iframe width="560" height="315" src="https://www.youtube.com/embed/6xfsTGTfZKU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -使用的icon: 機器人-driveArc (畫一個弧線線段) <a href="https://imgur.com/5GGHOOT"><img src="https://i.imgur.com/5GGHOOT.png" title="source: imgur.com" /></a> :::info (1)x,y資訊為圓心位置 (2)角度可為正負,逆時針轉為正角度 ::: 機器人-tracecolor(機器人路徑顏色選擇) <a href="https://imgur.com/mlkNXXc"><img src="https://i.imgur.com/mlkNXXc.png" title="source: imgur.com" /></a> :::spoiler **Solution:** <a href="https://imgur.com/zsOLSK2"><img src="https://i.imgur.com/zsOLSK2.png" title="source: imgur.com" /></a> ::: --- ##### 11.Level 11:請寫一個英文字母B <iframe width="560" height="315" src="https://www.youtube.com/embed/oZeNeTyZ-tk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> :::spoiler **Solution:** <a href="https://imgur.com/VmO8zKP"><img src="https://i.imgur.com/VmO8zKP.png" title="source: imgur.com" /></a> ::: --- ##### 12.Level 12:請畫一個藍色塗滿的圓圈 <iframe width="560" height="315" src="https://www.youtube.com/embed/QD7roHSONv8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -使用的icon: 畫畫 - filcolor (塗滿顏色) 畫畫 - stroke color (邊框顏色) <a href="https://imgur.com/RGd8fFT"><img src="https://i.imgur.com/RGd8fFT.png" title="source: imgur.com" /></a> :::spoiler **Solution:** <a href="https://imgur.com/20B0b5o"><img src="https://i.imgur.com/20B0b5o.png" title="source: imgur.com" /></a> ::: --- ## :memo:今日作業 今日請於RoboBlockly畫布中,控制機器人或繪畫出一幅屬於你自己的創作! **評分: 創意(6%)、美感(2%)** 創作完畢請截圖自己作品,至google classroom繳交作業。 **完成作業者才能得到證書!**