More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
post
page
◑ Python IDE Dashboard

Python Patterns

Here is a quick challenge to focus on the use of loops, nested loops and string manipulation using Python.

Let’s look at the following code:

This code uses nested “for” loops (a loop within a loop). The output will be as follows:

PythonPattern-1

Note that there are sometimes more than one solution to the same problem. Look at the following code which makes more effective use of string concatenation techniques:

This code would generate exactly the same outcome. It is more effective as it performs the same task using less instructions and iterations.

You can now adapt these techniques to try to produce the following patterns…

Python Patterns

Tagged with: , ,

How to create a bouncing ball in Scratch

BouncingBallStep 1 – Change your main sprite to a ball

BasketballSpriteStep 2 – Add the following script to your sprite:  BouncingBall_Script

This tutorial is available as a pdf: How to create a bouncing ball in Scratch

See how to create a Pong game using this code: http://scratch.mit.edu/projects/10128515/#editor

Tagged with: , , ,

What’s an algorithm and what is pseudo code?

Check this video/animation from Ted Ed to understand what we mean by algothirm and pseudo code.

Source: http://ed.ted.com/lessons/your-brain-can-solve-algorithms-david-j-malan#watch

 

Tagged with: ,

How to score points when your sprite collides with another sprite (in Scratch)

Scratch Tutorial -How to score points when your sprite collides with another spriteThis tutorial is available as a pdf.

It focuses on how to create a score variable for your game and how to score point when your sprite catches/touches/collides with other sprites.

Download this tutorial as a pdf:

How to Score Points when colliding with objects

Tagged with: ,

How to create flying/falling objects in Scratch

In this tutorial we will get a spaceship to fall from the top to the bottom of the screen.

scratch_FlyingRocket

Add the following code to your sprite (e.g. Spaceship):

scratch_FlyingRocketScript

xy-gridTo understand this script you need to understand how x and y coordinates work in Scratch.
When using scratch the “playing area” is based on the following grid:

  • The centre of the grid is (x=0, y=0)
  • The bottom left corner is (x=-240, y=-180)
  • The top right corner is (x=240, y=180)

 

You can download this helpsheet as a pdf: How to create flying or falling objects in Scratch

Tagged with: , , ,

How to create a timer in Scratch?

Step 1 – Create a new variable called “timer”.

Create a new variable called "timer"
Step 2 – Make sure you have two backdrops for your stage (The main background for your game and a Game Over background).

timer_BackDrop

Step 3 – Add the following code to your stage:

timer_ScratchAnnotatedCode

 You can download this helpsheet as a pdf: How to create a timer in Scratch

Tagged with: , ,

How to control your Sprite in Scratch…

arrowKeys… using the arrow keys

 

Step 1 – Add the following code to your sprite:

arrowKeys_ScratchStep 2 – If you don’t want your sprite to rotate, click on the blue “i” icon on your sprite. Try these “rotation style” options to find the one you need.

Scratch_SpriteRotation
mousePointer…using the mouse pointer

Instead of using the arrow keys you may prefer your sprite to follow your mouse pointer.
To do so add the following code to your sprite:

mousePointer_Scratch

You can download this helpsheet as a pdf:   How to control your sprite in Scratch

Tagged with: ,

Why are there 1024 bytes in a kilobyte? (instead of 1000)

Here is a good brainteaser when teaching binary code…

Remember: Computers can only work with binary code.

Computers don’t really like the number 1000 because in binary it’s not that straightforward:

binary1000The binary code for 1000 is 1111101000

However computers do like the number 1024 because its binary code is 10000000000.

Binary1024That’s why there are 1024 Bytes in a KB, 1024 KB in a MB and so on…

 

Tagged with: ,

Python Cheat Sheet

Python Cheat Sheet

You can download our Python Cheat Sheet to remind you at all times about the Python syntax.

Python Cheat Sheet

 

 

Tagged with: , , ,

Do you know your <HTML> tags?

HTML Cheat SheetDownload our HTML Cheat Sheet and use it as a reference when working on all your HTML web projects.

Tagged with:
Privacy Overview

This website will store some information about your preferences on your own computer inside a tiny file called a cookie. A cookie is a small piece of data that a website asks your browser to store on your computer or mobile device. The cookie allows the website to remember your actions or preferences over time.

You can delete all cookies that are already on your computer, and you can set most browsers to prevent them from being placed. However, if you do this, you may have to manually adjust some preferences every time you visit a site, and some services and functionalities may not work.

Most browsers support cookies, but you can set your browser to decline them and can delete them whenever you like. You can find instructions here for how you can do that on various browsers.

This website uses cookies to:

  1. Identify you as a returning user and to count your visits in traffic statistics analysis
  2. Remember your custom display preferences (such as light/dark theme option)
  3. Provide other usability features, including tracking whether you have already given your consent to cookies

Enabling cookies is not strictly necessary for the website to work but it will provide you with a better browsing experience.

The cookie-related information is not used to identify you personally and is not used for any purpose other than those described here.

There may also be other types of cookies created after you have visited this website. This site uses Google Analytics, a popular web analytics service that uses cookies to help to analyse how users use the site. The information generated by the cookie about your use of this website (including your IP address) will be transmitted to and stored by Google on servers in the United States. Google will use this information for the purpose of evaluating your use of other website, compiling reports on website activity, and providing other services relating to website activity and internet usage. Google may also transfer this information to third parties where required to do so by law, or where such third parties process the information on Google’s behalf. Google undertakes not to associate your IP address with any other data held by Google.