Programming on the Go Chapters 1and 2 Siddharth Patel 1000773753.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Introduction to Macromedia Director 8.5 – Lingo
Pages and boxes Building quick user interfaces. learning objectives o Build a quick UI with pages and boxes o understand how pages and boxes work o click.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
The Web Warrior Guide to Web Design Technologies
Introduction to TouchDevelop
True or false A variable of type char can hold the value 301. ( F )
VBA Modules, Functions, Variables, and Constants
Visual Basic: An Object Oriented Approach 4: Simple Programming in VB.
Guide To UNIX Using Linux Third Edition
JavaScript, Third Edition
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.3 The Class String.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
CHAPTER 3&4 ZHONGWEI LI TouchDevelop Book. What are we covering Review of Chapter 1-2 TouchDevelop as a scripting language: actions, events, table and.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Chapter 8: String Manipulation
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
1 TouchDevelop Chapter 8-10 Presenter: Jing Xu. 2 Outline Interactions Game Board Tiles and Printing.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Six Repeating Program Instructions.
Introduction to Python Basics of the Language. Install Python Find the most recent distribution for your computer at:
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Fundamentals of GUI Programming. Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
Introduction to touchdevelop statements overview Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including.
Chapter 15 Introduction to PL/SQL. Chapter Objectives  Explain the benefits of using PL/SQL blocks versus several SQL statements  Identify the sections.
Covenant College November 27, Laura Broussard, Ph.D. Professor COS 131: Computing for Engineers Chapter 5: Functions.
JavaScript, Fourth Edition
8-1 Compilers Compiler A program that translates a high-level language program into machine code High-level languages provide a richer set of instructions.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Introduction to touchdevelop values … and types Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including.
Getting started with the turtle Find the latest version of this document at
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
Introduction to touchdevelop statements overview Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including.
Unit 6 Repetition Processing Instructor: Brent Presley.
Language Find the latest version of this document at
Input Boxes, List Boxes, and Loops Chapter 5. 2 Input Boxes Method for getting user’s attention to obtain input. InputBox() for obtaining input MessageBox()
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Introduction to TouchDevelop Lesson 3 – Comments & Lists Created by S. Johnson
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
Introduction to Programming G50PRO University of Nottingham Unit 6 : Control Flow Statements 2 Paul Tennent
Web Database Programming Using PHP
Basic coding… with TouchDevelop!!
JavaScript, Sixth Edition
Unit 2 Technology Systems
Web Database Programming Using PHP
Introduction to Programming
JavaScript.
Explain what touch develop is to your students:
Explain what touch develop is to your students:
Introduction to TouchDevelop
CIS16 Application Development Programming with Visual Basic
Computer Terms Good to Know.
T. Jumana Abu Shmais – AOU - Riyadh
Introduction to TouchDevelop
Introduction to Programming
Web DB Programming: PHP
Introduction to Problem Solving and Control Statements
Introduction to Programming
Explain what touch develop is to your students:
Programming Basics Review
Presentation transcript:

Programming on the Go Chapters 1and 2 Siddharth Patel

INSTALLING TOUCHDEVELOP SCRIPTING LANGUAGE IMPORTANT WEBSITES Administrator INTRODUCTION

What Is Touchdevelop-definition TouchDevelop is an application development environment which allows users to script and design applications their mobile devices. The apps developed using Touchdevelop can use sensors, media, data on mobile, tablets or PC The scripts can interacts with cloud services including storage computing and social networks. What Can Be Done Using Touchdevelop? Games,productive apps, personalized phone …

In future smartphone might me the only computing device. SMARTPHONECAPABILITIES YesTEXT YesTALK Yes YesGAMES YesNAVIGATION NoPROGRAMMING

Traditional Mobile App Development Technique Use Computer to make mobile App Download APIs, SDK or need specific software For testing on mobile connect phone to computers Share project with teammates using hosting server

Touchdevelop Benefits and Challenges No specific device need No need to install huge SDKs for do specific settings. Share project or scripts with teammates on touchdevelop itself Benefits Challenges Mobile Phone Small Screen No Keyboard Touch screen interface as input

Installing Touchdevelop on a Windows Phone 1.Tap the Marketplace tile on the Windows phone. 2. Press the search icon at the bottom of the screen, and type the text ‘touchdevelop’ into the Marketplace Search text box. Before you finish typing all the letters, the TouchDevelop app should appear as a choice on the screen. 3.Tap that choice to select it. 4. Tap Install.

Installing Touchdevelop on Other Platforms Touchdevelop runs on web browser on any device Supported Browsers IE 10 Chrome(mobile) Firefox Safari(mobile) 1.Go to 2.Log in and that’s it!

The TouchDevelop Ecosystem the script can be shared on cloud infrastructure A user can share, comment, like the scripts User can find scripts in different categories like new, top featured, installed.

The Web interface It’s the same as the phone interface Mouse Keyboard Larger screen helps to increase productive to user might prefer the web interface but the PC may not have all the sensors like phone (GPS). Demo

The Scripting Language Statement oriented. Statements are executed in a sequential manner. The language is strongly typed. Its not an object oriented language.

Data types The Invalid Value: every data type has special value as Invalid value, it is assigned to show that the global variable has not been initialized or the method was unable to return the value. Example var numUsers := 0 … if connection failure detected then numUsers := invalid → number else … if numUsers → is invalid then “Script is terminating” → post to wall else The Invalid Type The Nothing Type A method or an operation which does not return a usable result, but which otherwise succeeded, actually returns a value of type Nothing. The sole value of type Nothing does not require any storage. Therefore this type is neither a value type nor a reference type. It is a special case.

Data types contd. Value Type Value types storages on the stack used for local variables. The storage is automatically deallocated on exit from an action.(Actions is called functions in other langualges ). Number: combines the integer and floating-point IEEE 754 (plus infinity, minus infinity can be computed) String : A sequence of zero or more Unicode characters. Showed as doublequote and backslash are used for special characters. Boolean: The type whose constants are true and false.

Data types contd. Value Type

Reference Type Global defined variables are stored as Reference Type. Storage for an instance of a reference type is allocated in a different place from a variable declared with that type. A local variable with a reference type is implemented as a pointer (a reference) to the actual value which is stored elsewhere. If the value represents any entity which exists outside TouchDevelop, then storage is allocated outside the TouchDevelop application. Otherwise the storage is allocated within an area of memory controlled by TouchDevelop which is called the heap. Data types contd.

Reference Type Data types contd.

Reference Type Data types contd.

Reference Type Data types contd.

Collection Types Touchdevelop provides homogeneous collections. A collection contains zero or more elements whose type is one of the value types or one of the reference types Collections which allow to insert or delete an element is called mutable, others are immutable. Data types contd.

Art Items Some scripts need to display pictures or to produce sounds. These pictures or sounds can be added to the script as global constants and become part of the script. Such items are held in the Art section of the script.

Expressions Explicit Constants Number constants are regular IEEE 754 standard 64 bit floating point numbers. String constants can be entered using Touchdevelop editor and string is implemented as Sequence of Unicode characters. Named Constants Touchdevelop has mechanism to construct constants for color and sounds. Such constants are called name constants. Demo

Variables Local Variables Local variables follow the usual visibility rules and lifetime rules for block structured languages. var s1 := “Hello!” Global Data Variables The data section of a script contains declarations for variables which are accessible by all actions within the script. If the type is Number, Boolean, String or DateTime, the variable has a neutral initial value. It is 0, false, “” or 1 January :00 am respectively. For any other datatype, the initial value is invalid. An access to a global data variable inside a script uses the special symbol. game := media → create board(480)

Operators

Operators Contd..

Statements Expression: Any expression may be used as a statement. For example, this is a valid statement. (“Hello “ || “ there!”) → post to wall Declaration and Assignment: A declaration of a local variable is combined with an assignment to initialize the variable. var places := collections → create location collection If an action has more than one return parameter. var street name := “” var street number := 0 street name, street number := ▷ Get Address Info(“Joanie”) If Statement: The TouchDevelop editor always generates the if-then-else form for an if statement, supplying empty bodies for the then clause and the else clause. if a < b then if a < c then min := a else min := c else if b < c then min := b else min := c

Statements Contd.. While Loop: while loop has a controlling expression which must evaluate to a Boolean value. The loop body is repeatedly executed as long as the controlling expression evaluates to true. var long song := invalid → song var my music := media → songs var num songs := my music → count var i := 0 while i < num songs and long song → is invalid do var sng := my music → at(i) if sng → duration > 10*60 then long song := sng else // nothing i := i + 1 For Loop: The for loop in TouchDevelop is similar to for loops in other programming Languages, but with some added constraints. The index variable must be a Number; it must be initialized to zero for the first iteration and it must be incremented in steps of one. For Each Loop: A for each loop is used for iterating through all the elements of a collection.

Actions Actions are basically the function of other languages. An action can have zero or more input parameters and zero or more result parameters. For example, consider the action Replicate defined as follows. action Replicate( s: String, n: Number ) returns r: String r := “” while n > 0 do r := r || s n := n – 1 The action can be invoked and its resulting value used in a statement like the following. (“The answer is “ || ▷ Replicate(“NO! “, 10) || “forever!”) → post to wall When an action is invoked, each result parameter is initialized to an invalid value of the correct type. When control reaches the end of the action, the final values of the result parameters are returned as the results of the call.

Calling a Library Action An action can be invoke action in a script which has been declare as library. Each such library script must be added to the library section of the script. When editing code in the script, the editor provides a button labeled libs. Tapping this key inserts the symbol into the code and the editor then provides a choice between the various names used for the imported library scripts. Once a name has been selected, the editor allows any action in that library script, other than those marked as private, to be called. There is no direct access to any global data items or art items declared in the script. Creating Library Scripts While editing the property of a script tick to the check box option library converts the script in to library. A library script cannot define any entries in its Events or Records sections.

Events Events are like actions. They cannot be invoked they must invoke when some external action happens. It might be phone sensors, like shaking the phone or touch to a particular area. An event will interrupt the normal execution of a script. However an event will never interrupt the code for another event while it is still executing.

IMPORTANT WEBSITES REFERENCES introduction to touchdevelop presentation at to touchdevelop