Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to touchdevelop if then else conditional statement Disclaimer: This document is provided “as-is”. Information and views expressed in this.

Similar presentations


Presentation on theme: "Introduction to touchdevelop if then else conditional statement Disclaimer: This document is provided “as-is”. Information and views expressed in this."— Presentation transcript:

1 introduction to touchdevelop if then else conditional statement Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and Windows Live are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.

2 introduction to touchdevelop if.. then.. o “if condition is true then do stuff” if balance < 0 then social→send (“me”, “empty!”, “”) o tell the phone to run code only if the condition is met

3 introduction to touchdevelop if.. then.. else.. o “if condition is true then do stuff else do other stuff” if balance < 0 then social→send (“me”, “empty!”, “”) else “enough balance!” →post to wall ☁

4 introduction to touchdevelop editing o tap + in the statement menu o tap the if button

5 introduction to touchdevelop editing o edit the condition o tap the hardware back button when done

6 introduction to touchdevelop exercises ►”play a random song; on shake, toggle the player between resume and pause” ►”ask the user a question (‘1+2=?’); if false, vibrate, if true play a victory song” wall→ask number to ask a number to the user ►”ask the user a duration in seconds; if the duration is between 0 and 5, vibrate for that amount of seconds” ☀ you can add an if statement inside of then or else.

7 introduction to touchdevelop true/false maths o known as Boolean logic o a Boolean condition may be true or false ortruefalse true falsetruefalse andtruefalse true false nottruefalse true

8 introduction to touchdevelop exercises ► true and false = ? ► false or true = ? ► not true = ? ► true or not true = ? ► not true and not false = ? ► not true or not false= ? in doubt, try it out on the phone…

9 introduction to touchdevelop title o item 1 o item 2 song→post to wall ☀ anecdote ☁ (link to sample)http://touchdevelop.com/velk ► an exercise ✿ a reference


Download ppt "Introduction to touchdevelop if then else conditional statement Disclaimer: This document is provided “as-is”. Information and views expressed in this."

Similar presentations


Ads by Google