In this Python challenge we will write two functions to calculate and return the Highest Common Factor (HCF) and the Lowest Common Multiple (LCM) of two numbers. Highest Common Factor (HCF) Note that the HCF is also known as the…
Euclid’s division algorithm is used to calculate the Highest Common Factor (HCF) of two positive numbers. It is based on Euclid’s division lemma and can be implemented in just a few lines of high level code. You can read more…
Computers hardware consists of all the components that you will find inside the computer (Motherboard, CPU, RAM, graphic card, sound card, network card, etc.) as well as all the peripherals/devices than you can plug to a computer. Peripherals are often…
ASCII Code The ASCII code (Pronounced ask-ee) is a code for representing English characters as numbers, with each character assigned a number from 0 to 127. For example, the ASCII code for uppercase A is 65. The extended ASCII contains…
Prolog is a language built around the Logical Paradigm: a declarative approach to problem-solving. There are only three basic constructs in Prolog: facts, rules, and queries. A collection of facts and rules is called a knowledge base (or a database)…
Many tutorials on how to create a game in Scratch will be based on using the arrow keys to control the main sprite. This is a great approach indeed but is not suitable if you are designing the game toe…
During the coronavirus pandemic, the rainbow has become a symbol of gratitude for the medical staff working in hospitals as well as all the other key workers who carried on working to provide essential services to their community. All over…
The luminance of a colour is a measure used to describe the perceived brightness of a colour. It is possible to calculate the luminance of a colour based on its RGB colour code. So let’s consider an algorithm that collects an RGB colour…
In this blog post we are investigating whether we can teach a computer how to perform a magic trick. Algorithm If you want a computer to perform a specific task you need to provide this computer with a clear set…