2.2.5
Turning an Algorithm into an App
Turning an Algorithm into an App
Turning an Algorithm into an App
You can use a coding program to turn your algorithm into an app. You can make an app from an algorithm by following these steps:
Create the background
Create the background
- Start by creating a background for your app.
Create the moving objects
Create the moving objects
- Create the moving objects.
- In the basketball game, the moving objects are the ball and the hand.
- Moving objects can also be called 'sprites'.
Name the moving objects
Name the moving objects
- Name the moving objects so you can apply different blocks of code to each one.
- You need to name them otherwise so you can tell the algorithms which parts the algorithm applies to.
Make the ball move and bounce
Make the ball move and bounce
- Make the ball move and bounce off the red and blue blocks and the walls.
- Blocks of code which create movement in objects or sprites are called 'movement blocks'.
Turning an Algorithm into an App
Turning an Algorithm into an App
You need to follow a few more steps to complete your app:
Event and Control blocks
Event and Control blocks
- You then need to add blocks of code called 'Event and Control blocks'.
- Event and Control blocks give ‘if … then’ and ‘repeat until…’ instructions.
Event and Control blocks 2
Event and Control blocks 2
- Event and Control blocks control the following in the basketball game:
- What happens if the mouse is moved? → the red block moves.
- What happens if the ball touches a wall or the hand? → the ball bounces.
- What happens if the ball touches each ‘basket’? → the score of the shooting team goes up.
- When does the game end? → first team to get to 5 points.
Variables blocks
Variables blocks
- Blocks of code that create variables (things that can change) are called variable blocks.
- Variable blocks of code give instructions for the selection of the colour, time, distance, the angle of bounces, etc.
1Computational Thinking & Algorithms
1.1Computational Thinking
1.2Algorithms
1.2.1Algorithms
1.2.2Pseudocode
1.2.3Flow Diagrams
1.2.4Logical Reasoning & Debugging
1.2.5Reading Algorithms
1.2.6Correcting Algorithms
1.2.7Complete the Algorithm
1.2.8Search Algorithms
1.2.9Linear Search
1.2.10Binary Search
1.2.11Sort Algorithms
1.2.12Bubble Sort
1.2.13Insertion Sort
1.2.14End of Topic Test - Algorithms
2Programming
2.1Programming Fundamentals
2.1.1Variables & Constants
2.1.2Comments
2.1.3Input & Output
2.1.4Arithmetic Operators
2.1.5Relational Operators
2.1.6Boolean Operators
2.1.7Sequence
2.1.8Selection
2.1.9Iteration
2.1.10Subroutines
2.1.11Scope
2.1.12Data Types
2.1.13Casting
2.1.14Arrays
2.1.152D Arrays
2.1.16Lists
2.1.172D Lists
2.1.18Strings
2.1.19Syntax Errors
2.1.20Logic Errors
2.1.21Runtime Errors
2.1.22End of Topic Test - Programming
2.2Designing Code
3Hardware & Software
3.1Hardware
3.2Software
4Data
5The Internet
6Online Safety & Security
6.1Protecting Yourself Online
Jump to other topics
1Computational Thinking & Algorithms
1.1Computational Thinking
1.2Algorithms
1.2.1Algorithms
1.2.2Pseudocode
1.2.3Flow Diagrams
1.2.4Logical Reasoning & Debugging
1.2.5Reading Algorithms
1.2.6Correcting Algorithms
1.2.7Complete the Algorithm
1.2.8Search Algorithms
1.2.9Linear Search
1.2.10Binary Search
1.2.11Sort Algorithms
1.2.12Bubble Sort
1.2.13Insertion Sort
1.2.14End of Topic Test - Algorithms
2Programming
2.1Programming Fundamentals
2.1.1Variables & Constants
2.1.2Comments
2.1.3Input & Output
2.1.4Arithmetic Operators
2.1.5Relational Operators
2.1.6Boolean Operators
2.1.7Sequence
2.1.8Selection
2.1.9Iteration
2.1.10Subroutines
2.1.11Scope
2.1.12Data Types
2.1.13Casting
2.1.14Arrays
2.1.152D Arrays
2.1.16Lists
2.1.172D Lists
2.1.18Strings
2.1.19Syntax Errors
2.1.20Logic Errors
2.1.21Runtime Errors
2.1.22End of Topic Test - Programming
2.2Designing Code
3Hardware & Software
3.1Hardware
3.2Software
4Data
5The Internet
6Online Safety & Security
6.1Protecting Yourself Online
Unlock your full potential with GoStudent tutoring
Affordable 1:1 tutoring from the comfort of your home
Tutors are matched to your specific learning needs
30+ school subjects covered