Block Programing
Free!
With Membership
$7.99
Suggested price

Block Programing

Learn MakeCode

About the Book

In contrast to text-based programming, block-based programming involves separating executable actions into modular units called blocks. 

Blocks are generally represented by icons, which can be selected and dragged to reorder. Users can input further information in editable fields, such as drop-down menus. The graphical representation of the code can make it easier for new users to understand the process.

About the Editor

Satnam Singh Khanuja
Satnam Singh Khanuja


- Telecom Professional with working in diverse fields of Telecommunications Service Business Operations, R&D (I&V), Customer support (Care L3), Network Solution Engineering, Project Management, Delivery, Assurance Management, and Process Management.


- Volunteer STEM Trainer for Government public high schools.


- Train 1500+ Teachers on the CBSE AI curriculam.


- Volunteer startup India mentor, incorporate & supports 9 startups.


- Speaker at various universities and Schools on "Get your kids digital ready".


About the Contributors

Harpreet Kour
Harpreet Kour
Satnam Singh Khanuja
Satnam Singh Khanuja

Co-Author

Table of Contents

What is Block 7 Data Types 8 Events 9 Blocks Language 14 Loops 14 If 15 Opposite condition: else 16 Opposite condition: else if 16 Boolean 18 Functions that return a Boolean 19 Boolean operators 19 Conjunction: A and B 19 Disjunction: A or B 20 Negation: not A 20 Number 21 An integer numbers. 21 Arithmetic operators 21 Relational operators 21 Functions that return a number 22 Math functions 22 Floating point: numbers with a fractional part 22 Remainder (%) 23 Exponent (**) 24 Integer multiply and divide 24 Integer Multiplication 25 Integer Division 25 Square root 25 Absolute value 25 Round 26 Ceiling 26 Floor 27 Truncate 27 Random value 27 String 28 Variables 29 Local variables 30 Assignment operator (=) 31 Change value 31 Text 33 char At 33 compare 34 Parameters 35 Returns 35 Substring 36 Parse Float 38 Array 39 Create an array 39 Items in an array 40 Length of arrays 41 Advanced 41 index Of 42 Parameters 42 Returns 42 Example 42 push 42 Parameters 43 Example 43 pop 43 Returns 44 Example 44 shift 44 Returns 45 Example 45 unshift 46 Parameters 47 Example 47 insert At 48 Parameters 48 Example 49 remove At 50 Parameters 50 Returns 50 Example 50 reverse 50 Returns 51 Example 51 Function 52 Defining a function 52 The function word 52 Name 53 Return value 53 Parameters 54 Body 55 Example 56 Calling a function 57 Image 58 Image layout 58 Zero size image 58 create 58 Setting pixels 60 Transparent pixels 60 Pixel colors 60 Transparency and overlap 60 Setting pixels at locations 61 Sprites 62 Sprite actions 67 Sprite effects 88 Sprite events 90 Sprite properties 94 Position 94 Physics 94 Image and Attributes 94 Activity Time 102 Game 107

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub