Está en la página 1de 32

Programming Languages spring-2017

SCRATCH/APP INVENTOR

GOWTHAM KOLA

1
CONTENTS:
1. Programming language history
3
2. Paradigm/Classification.
6
3.Compilers:
6
4. Applications:
8
5. Program Structure:
9
6. Data Types/Objects:
10
7. Sequence Control:
13
8. Input/Output:
15
9. Sup-program Control:
17
10. Encapsulation/Inheritance:
18
11. Example of a Simple Program:
19
2
12. list of questions in the website.
22
13.Screenshots of procedures in the
website 26
14.Conclusion

3
Programming language Research: App
Inventor
History:
App inventor is a programming language for creating
applications for mobile operating system Android.
It uses Graphical user interface for coding .
The first version of the software was made available in the
year 2010
The second version of the language was rolled out in the
year of 2013
App inventor is made to make programming simpler by
transforming text-based coding into visual, drag and drop

building blocks.
source: appinventor.mit.edu

4
The programming language is fundamentally based on MITs
open blocks which it later replaced.
Classification:

App inventor comes under the family of drag and drop


programming languages.
This family of programming languages have visual
components such as tiles and icons which can be put
together to construct a program.
Some other languages in this family are Scratch, StarLogo
etc.

Programming language history: Scratch


History:
Scratch is another visual programming language developed
MIT media lab.
The main usage of Scratch is to create animations, games
etc.
The language was influenced by other visual programming
languages like Logo, Hyper Card, StarLogo etc.
Jargon to be familiar with,
Sprite: a sprite is either user created or from sprite library is
an object that performs actons in a project.
Stage: A stage is a background, that can have scripts,
backdrops and sounds.
Blocks: blocks are puzzle piece shapes that are used to
create code in Scratch.
Script: A script is a collection or a stack of blocks that are
interlocked with one another.

5
The first version Scratch 1.0 was released in 2007
This first version has a total number of 95 blocks in 5 shapes
included in it.
Cap blocks which were later introduced in the the version 1.4
were stack blocks in the version 1.0
A typical stack block looks like

source: scratch.mit.edu

A typical cap block looks like

source: scratch.mit.edu

6
Second version of the language was scratch 1.1 which was
released 5 months after the release of version 1.0
The third version Scratch 1.2 came 7 months after the
release of version 1.1
The next version Scratch 1.3 was rolled out in September
2008.
The third version Scratch 1.4 came out in july 2009

Followed by version 2.0 in 2013.

Scratch 3.0 is the future version thats going to come out in


the near future it was released to a few selected personals
for beta testing.
That concludes the history and the versions of this language.
Paradigm/classification:
Scratch is an imperative block-based, event driven,
dynamically typed and interpreted programming language.
Dynamically typed: dynamically-typed means that if the data
types agree with the language are checked at execution
A few related languages to Scratch are Squeak, Flash,
Python, PHP, SQL, Mongo, GL Shader Language and Tosh
Compilers for Scratch:
Scratch is an interpreted language all the
implementations are executed directly.
Scratch is interpreted by ActionScript which is an
interpreted language on its own.
For versions 2.0 and later the interpreter in downloadable
from the website free of cost.
Applications of Scratch.

7
Scratch is mainly developed to be a fun, educational and
easy to learn.
Its mainly used by schools around the world as a means of
introducing basic computer programming for children.
The major applications of Scratch is building games, art and
simulations.
Program Structure Of Scratch:
A program in Scratch is basically a few blocks of code put
together in a jig saw puzzle manner that makes the program
executable.
The user interface of the programming language is divides
the screen into several panes
The middle of the pane has a blocks palette which has
coding blocks and on the right side there is a scripts area
and on the left of the pane there is stage and sprite list.
The blocks in the block palette can be dragged and into the
scripts area and make programs out of the blocks.
All the blocks are organized into 10 groups of blocks
according to its functionality i.e., motions, looks, sound, pen,
control, events, sensing, operators, variables and more
blocks.

8
source: scratch.mit.edu

Program Structure App Inventor:


The App Inventor mainly has blocks that are
categorized into several types namely
Control blocks, logic blocks, math blocks, text blocks,
lists blocks, colors blocks, variables blocks, procedural
blocks.

9
App Inventor is mainly used for programming mobile
applications for android operating system.
The basic interface of the App inventor has screens which
can be added as we go and each screen can be
programmed individually and connect them through the
blocks.
A basic program that has two buttons and one screen and a
couple pictures looks similar to,

10
And the designer side where all visible part like buttons and
images and other animations are dropped looks like

And the application that has been built looks like the video
below we can see that the arrow button points downwards
as we click on the button.

11
Data Types/Objects:
All the data types are in the form of blocks in Scratch called
Data Blocks.
Different types of Data Blocks are Stack Blocks, Reporter
Blocks, Boolean Blocks, List Blocks, and Variable Blocks .
Stack Blocks:
A stack Block is rectangular that is shaped to fit a block
both on top and below it.
These blocks are available in all categories but Operators
but PicoBoard Blocks.
Two stack blocks are connected to form a Script, and the
commands are executed from top to bottom

source: scratch.mit.edu

Reporter Blocks:
A Reporter block contains a value varying from a number
to strings
A reporter block looks like like

Boolean Block:

12
A Boolean block is a special form of Reporter Block that
report either true or false
A typical Boolean block looks similar to

List Block:
A list Block is a block that are used to manipulate lists in
the scratch.

Variable Block:
A Variable Block is a type of block that are used to hold
values and strings as well as displaying them via
monitors.

Sequence Control:
Sequence control is done by control blocks in Scratch.
These blocks are used to control Scripts in Scratch.
Different Control blocks in Scratch are
Control Hat block

13
The 3 control stack blocks are

There are 5 control c blocks they are

And finally the control cap blocks are

All of the sequence control is managed by these control blocks in Scratch.


Example of the implementation of a few control blocks is as follows,

14
As the block pauses its script until a condition is true, it is mainly used when
a script must wait for an event.

Input and Output in Scratch:


Input in in Scratch can be provided in several ways one of
which is using Answer Block.
An answer block comes under both sensing block and the
reporting block.
The block holds the most recent text inputted through Ask()
and wait() (Block)
Ask() and wait() (block) is a again both sensing and reporting
Block.
This block will make an input box which will take input from
users.
Users can input text into this block which will be saved in the
answer block. Answer block automatically updates to the
most recent input.

15
Below are a few examples for how the ask() and wait() block works.

and an example for the answer block is as follows


below is the example for how answer block works using a small game rock
paper and scissors.

16
output in Scratch can be outputted through say block or
custom blocks.
It can also be broadcasted through event blocks.
Encapsulation/Inheritance:
Encapsulation is not available in Scratch as of now.
Inheritance is mainly achieved by morphs
Morphic Inheritance often begins at the root block morph
Each morph is a sub block of either directly or Indirectly
Morph blocks are available in the world menu of Scratch
Sample program for addition of two
numbers.

17
The program involved in this is going to be.

output of this program is going to be.

18
19
that concludes the addition of two numbers program.

The List if questions that were being asked in the website.

20
1. What do you want to know about Scratch?

History

Applications

Control Structures

2. Happy to hear that you are interested in History !

Question: which version of Scratch are you interested in?

Scratch 1.4

Scratch 2.0

Scratch 3.0 beta

Happy to hear that you are interested in Applications !

3. Question: what is your favorite Application?

Simulations!

Gaming!

Animation!

4 Question: What in control structiures do you want learn?

Control cap blocks

Control c blocks

control stack blocks

21
The screenshots of whats happening in
the website are attached below.

22
23
24
25
26
27
28
29
30
31
CONCLUSION:
I learnt that Visual programming is an entertaining
way of programming.
And I made my first website ever.
Which is better than how I expected it to be.
I learnt how a database in a server can be remotely
accessed by writing a piece of code.
And all the languages that can manipulate the
server side of the programming and all the
languages on the browser side of the process.

32

También podría gustarte