用 Develop in Swift Explorations 打造跳舞機器人 BoogieBot

本次作業可從 Develop in Swift Explorations 裡 2–2 Play With Programs 來設計 BoogieBot。

下載好檔案後會先進入到這個畫面,到第十頁就可以將指令填入。

可以參照下面的指令替機器人指定動作:

leftArmUp(), leftArmDown(), rightArmUp(), rightArmDown()

leftLegUp(), leftLegDown(), rightLegUp(), rightLegDown()

shakeItLeft(), shakeItRight(), shakeItCenter()

jumpUp(), jumpDown()

fabulize(), defabulize()

以下為我的程式碼

startBot()startRecording()setBotTitle(“Robot Dance”)setBotSubtitle(“By AL”)shakeItLeft()shakeItRight()fabulize()leftArmUp()rightArmDown()shakeItCenter()leftLegUp()defabulize()jumpUp()rightLegUp()fabulize()shakeItRight()rightLegDown()func shake(){shakeItCenter()shakeItLeft()}rightArmUp()leftArmDown()leftLegUp()rightLegUp()jumpDown()shakeItRight()leftArmDown()shakeItCenter()jumpUp()leftLegUp()shakeItRight()rightLegUp()rightLegDown()func leg(){rightLegDown()leftLegUp()}

進階題

練習 Instances, Methods, and Properties.playground 的 page 15。

stage.startRecording()leftBot.botName = "Lefty"rightBot.botName = "Righty"stage.leftBot = leftBotstage.rightBot = rightBotleftBot.leftArmUp()leftBot.shakeItCenter()leftBot.rightArmDown()leftBot.defabulize()leftBot.fabulize()leftBot.leftArmDown()rightBot.fabulize()rightBot.leftArmDown()rightBot.leftLegUp()rightBot.jumpUp()rightBot.jumpDown()rightBot.rightLegDown()

--

--

--

學習 Swift iOS App 開發的學生作品集

Recommended from Medium

Setup Elasticsearch & Kibana via Docker

Limit User’s Access [ Linux Syst

ROS2 and Gazebo

Deploying .Net Core applications using Azure DevOps

Salesforce SSO Just-in-Time Provisioning for SAML with AXIOM

The Fundamentals of Coding

Tutorial: Deploy Camel-K on Openshift 4 using Tekton

GROWTH MINDSET AND MY TIME LEARNING TDD

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Al Hsieh

Al Hsieh

More from Medium

How to push logs to ElasticSearch and Cloudwatch from ECS-fargate using FluentBit?

How To Decrease Your Carbon Footprint

HW#7 Simple Fun of BoogieBot

The ultimate guide to Product Design fundamentals at Livspace

Illustration by Snehal Somkuwar