|
Welcome to your first Sheerpower programming lesson! Sheerpower is a fast and easy-to-use language, ideal for beginners who want to learn programming quickly. In this lesson, we'll cover the basics of Sheerpower by walking you through some simple examples. You'll write and run code snippets to see how Sheerpower works.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code. You should see the message "Hello, World!" printed below.
In programming, variables are used to store data that you can use and manipulate in your code. Sheerpower makes it easy to work with variables. Let's create a program that uses variables to store and display a message.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code. This program creates a variable called message$
to store a string (text), and then it prints that string.
Sheerpower can also handle numbers and perform arithmetic operations. Let's start with a simple program that adds two numbers together.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code. The program adds the two numbers and prints the result.
Now, let's try subtracting and multiplying numbers. You can modify the code to see how it works.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code. This program calculates the difference and product of two numbers and prints the results.
Loops allow you to repeat a block of code multiple times. This is useful for tasks like counting or repeating a calculation. Let's create a program that adds up all the numbers from 1 to 5.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code. This loop runs from 1 to 5, adding each number to the sum. The final result is the sum of all numbers from 1 to 5.
Conditional statements allow your program to make decisions based on certain conditions. Let's create a program that checks if a number is even or odd.
Instructions: Click the COPY button above to paste the code into the text area, and then click RUN to execute the code. The program checks if the number is divisible by 2 (even) or not (odd) and prints a message accordingly.
Hide Description
|
|
Results are shown here. Enter or modify the code below, and then click on RUN |
Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use. |