TouchDevelop Programming on the Go 3rd Edition R. Nigel Horspool - Get the ebook in PDF format for a complete experience
TouchDevelop Programming on the Go 3rd Edition R. Nigel Horspool - Get the ebook in PDF format for a complete experience
https://ebookfinal.com/download/go-climb-read-it-watch-it-do-it-go-
series-nigel-shepherd/
https://ebookfinal.com/download/an-introduction-to-programming-with-
mathematica-3rd-edition-paul-r-wellin/
https://ebookfinal.com/download/market-led-strategic-change-3rd-
edition-nigel-f-piercy/
https://ebookfinal.com/download/recording-on-the-go-the-definitive-
guide-to-live-recording-1st-edition-gary-gottlieb/
R High Performance Programming 1st Edition Lim
https://ebookfinal.com/download/r-high-performance-programming-1st-
edition-lim/
https://ebookfinal.com/download/prestressed-concrete-bridges-design-
and-construction-2nd-ed-edition-nigel-r-hewson/
https://ebookfinal.com/download/programming-in-lua-3rd-edition-
roberto-ierusalimschy/
https://ebookfinal.com/download/beginning-linux-programming-3rd-
edition-neil-matthew/
https://ebookfinal.com/download/cnc-programming-handbook-a-
comprehensive-guide-to-practical-cnc-programming-3rd-ed-edition-smid/
TouchDevelop Programming on the Go 3rd Edition R.
Nigel Horspool Digital Instant Download
Author(s): R. Nigel Horspool, Nikolai Tillmann
ISBN(s): 9781430261360, 1430261366
Edition: 3
File Details: PDF, 3.88 MB
Year: 2013
Language: english
This book was purchased by [email protected]
Chapter 5 Audio 73
5.1 Music 73
5.2 Sounds 79
5.3 Microphone 81
6.1 Camera 83
6.2 Working with pictures 87
6.3 Static graphics drawing and display 93
6.4 Playing videos from the internet 96
Chapter 7 Sensors 97
Index 245
Chapter 1
Introduction to TouchDevelop
TouchDevelop is a complete app creation ecosystem designed for touch,
cloud connected, mobile devices. This chapter provides a brief
introduction to the world of TouchDevelop scripting and the devices that
support it.
New smartphone and tablet models are getting more powerful and
becoming suitable for many tasks that used to require PCs. Mobile devices
have become well established tools for reading and composing emails,
browsing the web, and playing games. These devices are even being used to
2 | Getting started Chapter 1
annotate documents. And yet, the one task that can be seen as the defining
moment of any computing platform is not yet widely performed on
smartphones and tablets: writing code, or even creating entire applications.
The previous generation of people who grew up with full featured PCs
always had the option to program them. While most people chose not to do
that, they at least had the option. Decades of programming language and
development environment research produced powerful tools suitable for
PCs. It is through exploring this opportunity that many young people
became interested in computer science.
Unfortunately, in the new world of apps and app marketplaces with a focus
on existing curated content, it seems that the creative outlet of programming
that encouraged aspiring programmers in the past is no longer easily
accessible. The ability to program on the very device one owns and uses all
the time is not a prominent option anymore.
The TouchDevelop website provides a variety of scripts that can be used for
learning or as examples. Sample scripts meant to illustrate how to use the
built-in APIs can be found at the URL https://www.touchdevelop.com/pboj.
Scripts written by other users can be found by going to the TouchDevelop
URL https://www.touchdevelop.com/search and entering a term like ‘game’
into the search box. Alternatively one can explore the on-line API manual at
https://www.touchdevelop.com/doc/api.
4 | Getting started Chapter 1
touchdevelop.com
phone
browser
The TouchDevelop website allocates a unique deep link for each script on
http://touchdevelop.com; where each script is identified by a seemingly
random letter sequence. For example, https://www.touchdevelop.com/zpco
refers to a particular version of the TouchInvaders game, as in Figure 1-2. It
can be used to open the script directly. This link can be shared with other
people or on social networks.
If a user likes this script, he or she can show their appreciation of a script or
a comment by giving it a positive review in the form of a “heart”.
6 | Getting started Chapter 1
On any client, a phone or a web browser, the user can edit a script as shown
in Figure 1-3.
taking screenshots, etc. Since then, more than 90,000 people registered
online and shared more than 25,000 scripts, most of them written entirely
on phones. Many features were added over time, making TouchDevelop an
increasingly powerful development environment and language. The features
include support for libraries for code reuse and custom structured data
types.
In order to share scripts not only within the TouchDevelop environment, but
also with other people who might not be aware of TouchDevelop, we added
the ability to export scripts as apps that can be submitted to the Windows
Phone Store. This capability has existed since March of 2012.
In the near future, the update v3.0 of the TouchDevelop app for Windows
Phone will bring the same editing and execution engine that currently
powers the TouchDevelop Web App to Windows Phone 8 devices.
1.5 Platforms
There are a number of optional sensors for Windows Phones. “Near field
communication” (NFC), front camera, rear camera, magnetometer and
gyroscope may or may not be present in any given device model. Similarly,
8 | Getting started Chapter 1
some browsers choose to expose certain sensors while others don’t. Safari
on iOS exposes the accelerometer; Chrome on Android only partially, and
Internet Explorer 10 not at all. This variety is most likely an artifact of the
continuously evolving HTML5 standard; so, hopefully, more and more
sensors will be supported by all browsers as time goes by.
If your device is running Windows Phone 8, then you will get TouchDevelop
v3.0, which resembles the Web App at https://www.touchdevelop.com/app,
but it exposes many more sensors and data providers available on the
phone.
1. Go to https://www.touchdevelop.com/
2. Log in. You will be taken to the Web App.
The statements manipulate values. All intermediate values and variables are
statically type checked. Only parameters of actions have explicit type
12 | The scripting language Chapter 2
declarations. The datatypes of all other values and variables are inferred
through analysis of the code.
The language is strongly typed, in that (with one exception), every operation
requires operands of particular datatypes and there is no automatic coercion
to the type required by an operation. The datatypes belong to one of two
categories: value types and reference types. Value types may have storage on
the stack used for local variables, and their storage is automatically
deallocated on exit from an action (i.e. from a function). Reference types
have their storage allocated on the heap.
To conserve real estate on smaller screens, several symbols are used instead
of keywords. These symbols are all available as characters in the Segoe UI
Symbol font (a font which is distributed with the Windows 7 and 8 operating
systems). The symbols are summarized in Table 2-1.
The script comprises two actions and two events. The action named main is
the entry point for the script. The action named display song is called by
main. It has one input parameter named song (with type Song) and has one
result parameter named result (with type Number).
The main action defines and initializes a local variable named found. No
datatype is provided in that definition; it is inferred from the value used for
initialization which has type Number. The local variable named songs is, by
Discovering Diverse Content Through
Random Scribd Documents
“Be a good fellow, Wolf, and don’t say a word.”
“I will not if I can help it. I don’t think anybody will know
anything about this scrape. Those who saw the dummy come out
will suppose I was on her. But here’s a pretty kettle of fish!” I added,
glancing at the dummy, and then at the road minus the rails.
“Can we put the thing on the track again?”
“I think we can—we can try it, at least. We want some of those
rails for levers.”
“Where are they?” asked the puzzled Faxon. “Did some one steal
them for old iron?”
“No; they are not far off,” I replied, leading the way down to the
Lake Shore.
We walked along the beach, till I discovered footsteps in the
sand.
“Here is where they landed,” I added, pointing to the prints, and
also to some deep lines gored in the sand by a couple of boats,
which had been hauled up on the beach.
“Who landed? I don’t understand it.”
“I do; an enemy has done this. The Wimpletonians have been
over here during the night and torn up your track.”
“If they did, it will be a sorry day for them,” said Faxon, grating
his teeth and shaking his head.
“These footprints were made by dandy boots, and all the party
were boys. It’s as plain as the nose on Colonel Wimpleton’s face;”
and the great man of Centreport was troubled with a long proboscis.
“They’ll catch it for this.”
We walked along till we came to Grass Brook, and there we
found the rails thrown into the deep water at the mouth of it. The
end of one of them lay within my reach, and I pulled it out. Using
this as a lever, we pried up the wheels of the dummy, and, after an
hour of severe exertion, we succeeded in putting the car upon the
track.
CHAPTER XXIV.
THE GRAND PICNIC.
Corrections
pp. 43, 45, 47, 58, 198: had drank to had drunk
p. 49, seach to search
p. 77: ably to able
p. 226 illustration: FOR to FROM
p. 249: had not drank to had not drunk
p. 276: forget to forgot
*** END OF THE PROJECT GUTENBERG EBOOK THROUGH BY
DAYLIGHT ***
Updated editions will replace the previous one—the old editions will
be renamed.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com