Do Challenges

So you're getting better at coding? We've got some challenges for you.

So you're getting better at coding. Maybe you've earned some CoderDojo Stirling badges. Now try some of our challenges below!

Start completing challenges today:

  1. Pick an area below that interests you. There's Fun with Scratch, Making Websites, Coding (in Python or Javascript) and Microbits.
  2. Pick a challenge that looks fun.
  3. Do it!

Newest challenges:

Scratch: Make a Maths Quiz

Twine: Write an interactive story called 'Voice from the Postbox'

Websites: Make a website about the months of the year

Coding: Code a program that calculates coins needed to make some change

Microbits: Make the game Rock Paper Scissors


Fun with Scratch


Before you start

Scratch is a nice programming language for learning how to code. If you haven't used Scratch before, you can do our Scratch badges to get started. If you have used Scratch before, pick a challenge below and do it!


Challenge: I Wanna Be a Rockstar

Make a theatre stage with a band on it: a drummer, a guitarist, a singer, and anyone else you want. When you click on a person (or their instrument), the instrument sound should play. So when you click on the drums, you hear drums!

Getting started:

  • The Sprite Library has a “Music” category with useful sprites in it.
  • The Sound Library has lots of sounds you can use. Or record your own!

More advanced: Try clicking your band members at the right time, so it sounds like a proper song!


Challenge: Bear wants Dinner

Make a story about a bear searching for his dinner. The bear should move around, and tell the following joke to a frog:

  • Bear: "Why don't bears like fast food?"
  • Frog: "I don't know: Why don't bears like fast food?"
  • Bear: "Because they can't catch it!"

Hints:

  • You can find a ‘bear’ sprite in the Scratch sprite library. Or draw your own.
  • Sprites can speak with the ‘say’ command.
  • Sprites can have a conversation (one speaks after the other) using the ‘broadcast’ and ‘message’ commands


Challenge: Maze of Insults

Create a maze game. If you collide with a wall, you get teleported to the start, and told “you clumsy oaf”!

Getting started:

  • You will need 3 sprites: a player, the maze walls, and a finish point.
  • Use the ‘touch’ sensor to work out if the player has collided with a wall. You can detect when two sprites collide, or when one sprite collides with a colour.


Challenge: Animate Your Name

Make an animation of your name, so each letter does something cool like make a sound, or move around or change colour. I’m called GREG, so the G might spin around, the R might change from red to blue, and so on. The animation should start when the Green Flag is clicked.

Getting started:

  • Add letter sprites for your name: look in the Sprite Library under Letters. So I would add G, R, E and G.
  • For each character sprite, make it do something cool when the Green Flag is clicked.

More advanced: Make the animation cooler. You could make the background change, or make a bird fly around, or make the letters do things when you click on them.


Challenge: Catching Mice

Create a game where the player gets points when the cat catches a mouse, and loses points when the cat steps in a dog-poo.

Getting started:

  • You will need lots of sprites: a cat, lots of mice, a lots of dog poo.
  • Use the ‘touch’ sensor to work out if the cat has collided with something.
  • Use a ‘variable’ to track the score.

More advanced: can you make this game two-player?


Challenge: Aquarium

Build an aquarium with fish swimming around and plants at the bottom. The fish should turn round when they hit the aquarium edge.

Getting started:

  • You will need 2 sprites to start: a fish and a plant.
  • Look in the ‘motion’ section to make the fish move.

More advanced: Add a shark into the aquarium that is controlled with the arrow keys. Make the fish run away when they bump into the shark.


Challenge: Space Miner

Make a game about a space miner:

  • There’s a solar system with planets and asteroids (small lumps of space rock).
  • There’s a space ship.
  • The player moves the space ship to collect the asteroids. The player gets one point for running over each asteroid.
  • The space ship blows up if it crashes into a planet.

Getting started:

  • You will need different sprites for the spaceship, asteroids and planets.
  • Use the ‘touch’ sensor to work out if the spaceship has collided with an asteroid or planet. You can detect when two sprites collide, or when one sprite collides with a colour.


Challenge: Hide and Seek

Make a Hide and Seek game with the Scratch Cat: the Cat will appear somewhere on the screen, then vanish after 2 seconds. 6 seconds later, the Cat will appear somewhere else on the screen, then vanish again after 2 seconds. It does this forever. The player gets one point when they click on the cat, and lose a point if they click on the background.

Getting started:

  • Use two starting sprites: the Scratch Cat and the Background. Work out how to add and remove points from a score counter when these sprites are clicked.
  • Work out how to make the Scratch Cat appear and disappear with the ‘hide’ and ‘show’ commands.
  • Work out how to change the location of the Scratch Cat to a random x and y position.
  • If you need more help, the Scratch website has ‘step by step’ instructions for making a hide and seek game. Click on ‘Explore’ at the top of the main webpage, then look for ‘Hide and Seek Game’ on the right hand side.


Halloween Challenge: Escape the Graveyard

Make a game about escaping a graveyard. You start at one side of the graveyard, and have to escape through a gate on the other side. The graveyard has grave-stones in the ground, and ghosts that move around. If you collide with a grave-stone or a ghost, you get teleported to the start.

Getting started:

  • You will need some sprites: the player, gravestones, and ghosts
  • Use the ‘touch’ sensor to work out if the player has collided with a gravestone or ghost. You can detect when two sprites collide, or when one sprite collides with a colour.

More advanced: Make the graveyard more spooky. What about making an invisible ghost appear when the player hits a gravestone? Maybe it says “boo!” (record the sound effect)


Challenge: Parachute Jump

Make a game about someone doing a parachute jump, and having to dodge moving clouds. If they hit a cloud, they lose the game.

Getting started:

  • Draw your parachutist
  • Draw some clouds - you'll need a few!
  • To make the game, put the parachutist near the top of the screen (they won't move). Now make each cloud move from the bottom of the screen to the top, and it will look like the parachutist is falling! There is a trick to this, as you want each cloud to start off-screen at the bottom, and move up until it goes off-screen at the top. When the cloud gets to the top, move it to the bottom again!:
    • To start the cloud off-screen at the bottom, set y to be less than -180 (try -200)
    • To check when the cloud has gone off-screen at the top, check if y is more than 180 (try 200)
    • Scratch doesn't like putting sprites off-screen, but you can trick it: every time you move the sprite's position (x and y), put "set size to 200%" before, and "set size to 100%" after. Strange, but this seems to work!

More advanced: make things harder, with more clouds moving randomly at different speeds. You could also keep score by counting how many clouds the parachutist dodged. Or make things look cooler by changing the background: what about thunder and lightning, or snow?


Challenge: Maths Quiz

Make a quiz where the player has to multiply random numbers together. "What's 2 times 7?". "14". "Correct!".

Getting started:

  • You'll need a sprite to ask the quiz question. For now, ask: "what's 2 times 7?"
  • Let the player enter the answer
  • Compare the player's answer against the real answer (14). If they match, the sprite should say "correct!" or "wrong!" if they don't
  • Now make the quiz question use random numbers (not just 2 and 7). This is a bit tricky:
    • You will need two 'variables' to store the random numbers
    • Scratch can pick a random number for you using the 'pick' block (look under 'operators')
    • The quiz question must use your two number variables
    • To check if the player's answer is correct, you will need to compare it against the two number variables multiplied together

More advanced: make the quiz ask 10 questions, and keep a score of correct answers. And do more fun stuff when the player gives a right answer (yay!) or wrong answer (boo!).


Challenge: Whistle for the Wind

Make a scene with a windmill (or wind turbine) and a cloud. Make the windmill turn and the cloud move across the sky. Now here's the fun bit: make the windmill turn faster the louder you whistle (or yell) into your computer's microphone. The cloud should move faster too. The louder you whistle, the stronger the wind!

Getting started:

  • Make a windmill with sails that turn: you can use "turn x degrees" (look under 'motion')
  • Make a cloud that moves across the sky
    • Use 'set x' and 'set y' to set the cloud's starting position
    • Make the cloud move using 'change x'
    • Once the cloud crosses the whole screen, move it back to its starting position (so we don't lose it off the screen!)
  • Now for the whistling bit.
    • Scratch has a 'loudness' value (look under 'sensing'). It measures how loud the noise is that your computer's microphone hears, from 0 to 100.
    • Use the 'loudness' value to change how fast the windmill turns and the cloud moves.
    • For the windmill, try "turn 'loudness' degrees"
    • For the cloud, try "change x by 'loudness'" (to make the cloud go in the other direction, multiply by -1)

More advanced:

  • Add more clouds, and make their starting position random (the y value).
  • Change the colour of the clouds as they move
  • Add a meter that shows how much electricity is generated by the windmill


Challenge: Reaction Time

Make a game that measures your reaction time: how fast you can click when Scratch cat changes from his normal orange colour to blue. At the end of the game, show your reaction time (it will be in milliseconds, which is a second divided into 1000 parts). What's the fastest you can click?

Getting started:

  • You will need a Scratch cat sprite, with a orange and a purple costume.
  • You can measure reaction time using the 'timer' block in the 'sensing' section: use 'reset timer' when you want to start timing, and assign 'timer' to a variable when you want to record the end reaction time.
  • You can also use the timer to wait a few seconds at the game start before you switch Scratch cat's costume.
  • Use different backdrops for different stages of the game: to show instructions at the beginning, to show when to click on scratch cat, and to show reaction time at the end.

More advanced:

  • Make the player pay attention: randomise the time at the game start before you change scratch cat's costume.
  • Tell the player off if they click too early (before scratch cat is purple).
  • Let the player have multiple goes, and calculate their average reaction time.


Challenge: Insult Generator

Make a Scratch program that generates random insults :-) Scratch cat first asks for your name, then insults you. Here goes..

  • "What's your name?"
  • "Greg"
  • "Hi Greg. You eat like a greasy baboon!". Or maybe "Hi Greg. You run like a purple hippo!"

Getting started:

  • You will need a Scratch cat sprite.
  • Now get Scratch cat to ask your name, and say hello ("Hi Greg"). Useful Scratch blocks:
    • 'ask and wait' under Sensing
    • 'say' under Looks
    • 'join' under Operators (used to join words together into a sentence)
  • Generating the insult is the tricky bit. Each insult is a sentence with the same structure: "Hi (Greg - name). You (eat - doing word) like a (greasy - describing word) (baboon - naming word). So we'll generate the insult by randomly picking a doing word, a describing word and a naming word, then making a sentence out of them:
    • Make a list of doing words (verbs). Use 'Make a list' under 'Data'. How about: eat, run and swim.
    • Make a list of describing words (adjectives). How about: greasy, smelly, grumpy.
    • Make a list of naming words (nouns). How about: baboon, cardboard box, dolphin.
    • Now we'll generate the insult by randomly picking a word from each of the three lists, and combining them into a sentence. To randomly pick a word, use 'item random of list-name' under Data. To combine the words into a sentence, use 'join' under Operators. You'll need to use 'join' multiple times.
    • Go make some fun insults!


Challenge: To the Moon

Write a game about flying to the moon. There should be three stages in your game: one set on Earth; one in space and one on the moon.

To start the rocket the player should press the space bar five times. Then the rocket should fly into the air. When the rocket reaches the top of the screen, the background should be changed to the next background (e.g. from Earth to space). Along with placing the rocket at the bottom of the screen again. The player should be able to move the rocket left and right using the arrow keys. There should be Aliens and other space-ships flying around. If the player touches one of these they lose the game. When the player reaches the last stage (the moon) a target should appear. The target should be placed at the top of the screen. If the player hits the target then they win the game.

Hints

  • For a spaceship sprite look in the sprite library (they'll be found in flying).
  • To count the number of times the player has pressed space make a variable (found under data). Then every time space is pressed add one to this variable. Use the wait until block to make the sure the rocket doesn't fly off until the variable equals five. Ask a mentor for help if you haven't used variables before.
  • To change the background check whether the y coordinate is bigger than 180, then use the switch background block.

Advance

If you manage to complete the above try and place the target at the bottom of the screen. Then have the rocket start at the top and move down the screen (towards the target).


Balloons

Write a small game about popping balloons. In the game the balloons should float from the bottom to the top of the screen. When the player clicks on a balloon then it should disappear from the screen, and a popping sound should be played. Then one should be added to their score. There should be other items floating up the screen; if the player clicks on any of these they should lose a point.

Advanced

  • If the player's score falls below zero then a game over screen should appear.
  • Add a lives system to the game. If the player clicks on something that isn't a balloon then they lose a life. When the player runs out lives they lose the game.

Back to School Supplies

So you're going back to school - you'll need to make sure you've got a pencil, notebook and calculator.

Fortunately, it's raining school supplies. Your sprite needs to walk back and forth across the screen catching pencils, notebooks and calculators in their backpack. Set up a timer so that players have one minute to collect as many as they can. Set up a counter to count how many items they catch.

Hints:

  • Draw a sprite of you in school uniform, with a backpack. You will need two costumes: one for when you are walking left, and another for walking right.
  • Draw a pencil, notebook and calculator sprite. To make them fall from the sky, set their original location to a random position at the top of the screen, then move their location down the screen. When they get to the bottom, move them back to the top.
  • An easy way to 'catch' a notebook (or whatever) in your backpack is to make the backpack a special color, then add an action to the notebook sprite when it touches the special color. So you could hide the notebook, and add a point to the score.

Advanced

  • Add a second level with extra supplies. If any supplies hit the ground, they explode!
  • Add something that you should not take to school. If the player catches that item accidentally, a message flashes up "You're in Detention!"

Frogger

Make your own version of a classic 1980s game called "Frogger". Check out this video. The aim of the game is to guide a frog from the bottom of the screen to the top of the screen, whilst crossing lanes of a busy road. Each lane contains moving cars, buses, cyclists and other vehicles - don't let the frog get run over! The player moves the frog using the arrow keys (hopping forwards, back, left or right). The player wins by guiding the frog safely to the top of the screen.

Hints:

  • You'll need a frog sprite. Make it "hop" up, down, left and right using the arrow keys.
  • You'll need some vehicle sprites. Move them left to right (or right to left) along a road. You can draw roads in the background image. To have constant traffic, start each sprite on the the left of the screen, then move it right. When the sprite gets to the right of the screen, move its location back to the left.
  • You can detect collisions between the frog and a vehice based on colour (when touching "frog" colour) or sprite (when touching "frog" sprite).

Advanced

  • Add scoring: 10 points every time the frog moves forward, and 50 points when the frog crosses all roads successfully.
  • Add a time limit: frog must cross in under 30 seconds.
  • Add multiple frogs: the player has to guide 5 frogs across the roads, one at a time.

Halloween Scene

Create a Halloween scene: for example a spooky forest or a graveyard. When you click on anything in the scene, something scary should happen. A spider drops from this tree; an owl flies out of that one; a ghost pops out from behind a gravestone; a witch flies cackling across the moon. How many spooky surprises can you put in?

Hints:

  • You'll need sprites. Look in the sprite library, or draw one, or load one in from an image.
  • For surprises, a sprite could move or appear, say something, or make a sound. You could even record your best ghost noise!


Santa Present Drop

Santa needs help dropping presents down chimneys. Make a game where Santa flies across the sky over some houses with chimneys. When the mouse is clicked, Santa drops a present which falls downwards. If the present hits a chimney, you score 1 point. If the present hits something else (like a roof), you score nothing. In either case, the present vanishes, and you get to try again. You win once you've scored 10 points.

Hints:

  • You'll need a Santa sprite. Make him fly across the top of the screen. When Santa hits the edge of the screen, make him fly in the opposite direction.
  • You'll need a sprite of some houses with chimneys. Use two different colours for the chimney tops and the rest of the houses.
  • You'll need a present sprite. When the mouse is pressed, make the present appear at Santa's location. Then move its position gradually down the screen. You can work out if the present lands on a chimney. top by using "if touching chimney top colour". You can check if the present lands on a house instead by using "if touching house colour".
  • You'll need a variable to keep track of the score. Add 1 to the score when a present drops on a chimney top.

Advanced

  • Add fun sounds: Santa saying "ho ho ho", a "yay!" noise when a present hits a chimney, and "boo hoo!" when it doesn't
  • Add levels: once you score 10 points, move up one level. Santa should fly faster as each level increases. You will need a second "level" variable for this.

Avoid Cake

Scratch Cat has made a New Year Resolution not to eat cake. Write a game where Scratch Cat has to dodge cakes that fly round the screen. If Scratch Cat touches cake, he loses a life (and the cake vanishes - yum yum!). Scratch Cat has 9 lives. When he runs out of lives, the game finishes. The player should then be told how many seconds Scratch Cat survived.

Hints:

  • Make Scratch Cat move left, right, up or down when the player presses the matching arrow key.
  • You will need some cake sprites. To make them bounce around the screen, you can use the "if on edge, bounce" block, in the "Motion" section.
  • You will need a "variable" to count the number of lives remaining. Look in the "Data" section.
  • You will need a "timer" to count how long Scratch Cat survived. Look for the "timer" block in the "Sensing" section.

Advanced

  • Make the game harder: make the cake move towards Scratch Cat, add more cake, and make the cake move faster.
  • Add difficulty levels: let the player choose at game start how hard they want the game to be. Then set cake speed based on difficulty.

Robot Disco

Make a scene of a robot disco! There are two robots dancing, waving their arms and their legs. There should be crazy electronic music playing, and some flashing lights. Make it a cool robot disco.

Hints:

  • Make a robot by creating a new sprite, and drawing its costume out of shapes like squares and circles. Make sure the robot has arms and legs!
  • To make the robot dance, you will need to make a second costume that looks the same as the first, but has arms and legs in slightly different positions (you will then flip between the costumes very quickly, so it looks like the robot is dancing). To make a second costume, right click on the first costume and select 'duplicate'. Now you can move the arms and legs in the second costume.
  • Flip between the costumes using the 'next costume' block inside a 'forever' block. You will also need a 'wait n seconds' block to change how fast the costumes change.

Advanced

  • Make the robot dance more smoothly by adding more costumes. So only move the robot's arms and legs a little bit in each costume.
  • Make the robot disco as cool as possible. Can the robots move? Can you add more robots? Can you record your own (beat boxed) soundtrack?

Easter Egg Hunt

Make an Easter egg hunt game - the player wins by finding 10 Easter eggs hidden behind trees, rocks and animals in a country scene. Eggs should appear in random locations for a few seconds then vanish again. If you click the egg then you gain a point.

Hints:

  • Make a few egg sprites. You can draw one, or mess with a balloon sprite in the Scratch library.
  • Make a country scene with some stuff in it like animals and trees.
  • Place an egg in a random position, show it for a few seconds, then hide it. You can do this with the blocks "hide", "show", "wait".
  • If the egg is clicked, then add 1 to the score variable. The game finishes when the score reaches 10.
  • You can hide eggs behind other sprites (like the animals and trees) by using the "go back 1 layer" block, or "go to front layer" to move it to the front.
  • Advanced: keep track of how long it takes for someone to finish the game. When the game ends, tell them how long they took.

April Showers

It rains a lot in April. Make a game where you dodge raindrops. Get hit by 3 raindrops, and the game finishes. The player should be told how many seconds they survived.

Hints:

  • You will need a player sprite to move left and right at the bottom of the screen, to dodge the raindrops. Draw a sprite yourself, or pick one from the scratch library. Then make it move left and right when the arrow keys are pressed
  • You will need raindrops to fall from the sky. Draw one raindrop. When the game starts, hide this raindrop, then "clone" it every half a second (look in the "control" section). Use the "when i start as a clone" block to tell each cloned raindrop what to do (also in the "control" section). Each clone should:
    • Appear using "show"
    • Start at a random location at the top of the screen. Use a y position of 180, and a random x position between 240 and -240
    • Move down the screen
    • Delete itself at the bottom using the "delete this clone" block
  • You can check if the player has hit a raindrop using the "touching sprite" block in the "sensing" section
  • You will need a variable to keep track of how many hits the player has taken. When the player touches a raindrop, subtract 1 from the variable. When the variable gets to zero, the game finishes
  • You can measure how long the player survived using the 'timer' block in the 'sensing' section. Use 'reset timer' to start timing, and assign 'timer' to a variable to stop timing (when the game finishes)

YouTube tutorial: make a zombie survival game

There are some good video tutorials on YouTube that show you how to make cool things with Scratch. Follow along with this 10 minute video tutorial, where you learn how to make a zombie survival game: the player is attacked by zombies, and can run around and shoot the zombies.

Once you have your own zombie game working, then you can improve it how you want, or keep watching more video tutorials in the series. There are 9 more videos: part 2, part 3, part 4, part 5, part 6, part 7, part 8, part 9 and part 10.

There are plenty more video tutorials on YouTube about making games in scratch: try searching for "Make a scratch game". For example, here is a video playlist that shows how to make a 'cat chasing mouse' game, a 'whack a mole' game, and more.


Virtual pet: beach holiday

Scratch Cat has gone on holiday to the beach. He will need regular food, drink and sunscreen to enjoy himself. If he doesn't get enough of each then he'll be hungry, thirsty and sunburnt. Scratch Cat will then come home from holiday early as he feels unwell. Sadness.

Make a "virtual pet" game where you keep Scratch Cat on his beach holiday for as long as possible. You will need to give him food, drink or sunscreen, depending on what he needs. The basic idea is that you have "variables" that show how Scratch Cat is feeling, like: "Hungry: 4". Scratch Cat gets hungrier over time, so the variable starts at zero and increases 2 points every 5 seconds. The player can reduce points by feeding Scratch Cat: they do this by clicking on some cat food. If the "Hungry" variable gets to 20 points, then Scratch Cat feels unwell and goes home early: the game finishes. You will need three different variables: "Hungry" (fixed by cat food), "Thirsty" (fixed by a water bowl), and "Sunburnt" (fixed by sunscreen).

To get started, let's deal with Scratch Cat being hungry:

  • Add the Scratch Cat sprite and a beach background
  • Add a variable called "Hungry", and set it to zero when the game starts. Then make the variable increase 2 points every 5 seconds.
  • Add a "cat food" sprite. Reduce the "Hungry" variable by two points when the player clicks on the cat food.
  • Check to see if the "Hungry" variable is 20 points or more. If it is, then stop the game: make Scratch Cat say that he's going home.

Next steps:

  • Add "Thirsty" and "Sunburnt" variables, fixed by a water bowl and sunscreen
  • Increase the variables randomly, so "Hungry" increases between 2 to 4 points, every 5 to 10 seconds
  • When the game finishes, tell the player how long Scratch Cat was on his beach holiday.


YouTube tutorial: make a RPG/Adventure Game (2017)

Learn how to make an adventure/RPG (role-playing game) game by following along with this 10 minute video tutorial.

Once you have your own game working then you can improve it how you want, or keep watching more video tutorials in the series. There are 6 more videos: part 2, part 3, part 4, part 5, part 6 and part 7.


Spy Name Generator

Make a Scratch program that generates random spy names :-) Scratch cat first asks for your name, then tells you your spy name. Here goes..

  • "What's your name?"
  • "Greg"
  • "Hi Greg. Your spy name is Smelly Weasel". Or maybe "Hi Greg. Your spy name is Pink Milkshake"

Getting started:

  • You will need a Scratch cat sprite.
  • Now get Scratch cat to ask your name, and say hello ("Hi Greg"). Useful Scratch blocks:
    • 'ask and wait' under Sensing
    • 'say' under Looks
    • 'join' under Operators (used to join words together into a sentence)
  • Generating the spy name is the tricky bit. Each spy name is a sentence with the same structure: "Hi (Greg - name). Your spy name is (Smelly - describing word) (Weasel - noun)". So we'll generate the spy name by randomly picking a describing word and a naming word, then making a sentence out of them:
    • Make a list of describing words (adjectives). Use 'Make a list' under 'Data'. How about: Smelly, Pink and Furry.
    • Make a list of naming words (nouns). How about: Weasel, Milkshake, Goblin.
    • Now we'll generate the spy name by randomly picking a word from each list, and combining them into a sentence. To randomly pick a word, use 'item random of list-name' under Data. To combine the words into a sentence, use 'join' under Operators. You'll need to use 'join' multiple times.
    • Go make some fun spy names!

To finish things off, let's replace Scratch cat with M: head of the Secret Service in James Bond films. Make a new sprite for M: they should be dressed in normal clothes. Now add an extra "spy" costume for M: they should be dressed like a spy, with dark glasses, a fake moustache, and maybe all in black. When M asks your name, show them in their normal costume. But when M tells you your spy name, show them in their spy costume. Cooool.


Going to School

Make a story about you going to school. There will be 3 screens (each using a different backdrop):

  • First, your bedroom. Your Mum comes in and says "wake up!"
  • Second, on the way to school. You meet a friend and say hi to one another
  • Third, at school. Make something interesting happen, like being attacked by a giant octopus, or have a witch flying overhead
Getting started:
  • Scratch has different sprites and backdrops you can choose from, or you can create your own. For backdrops look bottom left for "Choose backdrop from library"
  • You can switch between backdrops using "switch backdrop" in the "looks" section.
  • So you and your Mum have a conversation in the bedroom: Mum says "wake up!", then you say "ok!". Your two sprites have to take turns saying something. Use the "broadcast" and "when I receive" blocks in the "events" section to make this happen. Watch this 4 minute video showing how it's done


YouTube tutorial: make a shoot ’em up game with planes

Learn how to make a shoot’em up game by following along with this 10 minute video tutorial. Your aeroplane is being attacked by a swarm of enemy planes!

Once you have your own game working then you can improve it how you want, or keep watching more video tutorials in the series. There are 12 more videos: part 2, part 3, part 4, part 5, part 6, part 7, part 8, part 9, part 10, part 11, part 12 and part 13.


Rudolf hunts for his red nose

Rudolf woke up on Christmas morning and couldn't find his red nose. Make a reindeer sprite either from a picture or by drawing in Scratch. Draw a complicated maze sprite and hide a sprite of Rudolf's nose somewhere in it. Make Rudolf move with keys on the keyboard. He should bounce off the walls of the maze. When he finds his nose, change sprite costumes so that his nose disappears from the maze and appears on Rudolf.

Getting started:

  • You will need three sprites; one for Rudolf, one for his nose and one for the maze
  • Some sprites will need multiple costumes
  • To make something disappear you can change costume or you can use the show and hide blocks

More advanced: Animate a celebration after Rudolf finds his nose with fireworks and dancing.


Flappy Parrot

Make a "Flappy Parrot" game by following along with this tutorial. Like Flappy Bird, but with a parrot!

After that: the Flappy Bird tutorial comes from the Raspberry PI website, which has a bunch of other Scratch projects. Try them out.


Challenge: Melting Snowman VS Supermoon

Ron the snowman is struggling with the warm weather - he's in constant danger of melting. Can you keep him safe from Supermoon who wants to make the night as hot as your summer holidays.

Getting started:

  • You will need two sprites; one for Ron, and one for Supermoon
  • Ron the snowman needs several costumes to show how melted he is
  • Make Supermoon fly across the screen to chase Ron
  • Animate Ron so he moves when you press keys on the keyboard
  • If Supermoon gets close to Ron change his costume to make him look more melted
  • Draw a wintry night time background

You can find out more about the recent super moon here.

More advanced: Add a score to the game with some text beneath that says how melty Ron the snowman feels.


Pattern art generator

Draw patterns in Scratch to make beautiful art.

Getting started:

  • Follow this tutorial to learn how to draw a circle.
  • You will also learn how to make a custom "draw circle" block that you can reuse.
  • This tutorial shows you how to use your "draw circle" block to make a fab pattern.

More advanced: change the circle block to draw a square instead.


Boat Maze

Follow along with this tutorial, when you get to race a boat through a sea maze to a desert island. Don't crash the boat!

YouTube tutorial: make a car racing game

Learn how to make a racing game (try it out) by following along with this 20 minute tutorial. Then improve the game by watching more videos in the series: part 2, part 3, part 4, part 5, part 6, part 7, part 8 and part 9.


YouTube tutorial: make a snake game

Learn how to make the classic game of "snake" by following along with this 12 minute tutorial.


YouTube tutorial: make a scrolling platformer game

There are some good video tutorials on YouTube that show you how to make cool things with Scratch. Follow along with this 12 minute video tutorial, where you learn how to make a scrolling platformer game, like Super Mario.

Once you have your player moving in the game, keep watching more video tutorials in the series to make the game better. There are 9 more videos: part 2, part 3, part 4, part 5, part 6, part 7, part 8, and part 10. Or here is the full series playlist.


Fly a bird in Scratch with a microbit!

You can use a Microbit to control things in Scratch. We're going to fly a bird using a Microbit. Tilt your Microbit to make your bird fly up and down, and use the A and B buttons to speed up or slow down.

Getting started:

  • Follow this tutorial to get the Microbit Scratch Link up and running.
  • You can now access new Microbit blocks in Scratch.
  • You will need a bird sprite. The bird sprite will fly across the screen from left to right. Make the sprite start again at the left side of the screen when it reaches the right hand side.
  • Use the when tilted front and back blocks in the Microbit section to make your bird fly higher or lower on the screen.
  • Use the when button pressed blocks in the Microbit section to make your sprite speed up or slow down as it flies across the screen.


Make a Christmas card

Make a fun Christmas card with Scratch. You can put anything Christmas-ey on it: Christmas trees, santa, reindeer, the nativity, ... Can you make it fun? The card could play music in the background, or maybe when you clicked on something. And you could animate it, so a christmas present might unwrap itself when you clicked on it. And it could snow.


No More Doughnuts

Scratch Cat has made a New Year’s resolution not to eat any more doughnuts. Make a game where Scratch Cat has to dodge flying doughnuts. If he hits a doughnut, he loses the game.

Getting started:

  • Put Scratch Cat sprite on the left of the screen. Make him move up, down, left and right when you press the arrow keys.
  • Draw a doughnut sprite.
  • To make the game, make doughnuts start just off the right side of the screen, then fly left until they go off the left side of the screen and vanish. Scratch Cat will have to dodge them. The easiest way to do this is to have just one doughnut sprite. When the sprite starts, immediately “hide” it, then use “create clone of myself” forever. Use “when I start as a clone” to first show each clone doughnut, place it off the right side of the screen (with a random "y" location), then move it to the left side of the screen and “delete this clone”.

More advanced:

  • Make Scratch Cat dodge different types of cake - not just doughnuts.
  • Make Scratch Cat have 5 lives - he can hit 5 cakes before losing.
  • Make Scratch Cat get bigger as he hits (eats) cakes. You might need to use your own sprite so you can create different costumes for this.


Pancake flipping game!

Pancakes are popular this time of year. They can be sweet or savoury but they all need flipping over! Make a game where you flip a pancake, and have to catch it in a frying pan.

Getting started:
  • You will need two sprites, a pancake and a frying pan.
  • When the game starts the pancake will be on the frying pan. They will be in the same position.
  • When the player presses T for toss, the pancake should move up from the pan and spin.
  • When the pancake hits the side of the screen it should bounce off.
  • If the pancake touches the pan it is "caught" and could be placed on the pan.
  • If the pancake hits the floor it could change costumes to a splattered mess.
  • The pan needs to move side to side so it can catch the pancake. You might want to flip the pan so it points in the direction of motion.

More advanced: Add a variable to keep score - gain a point if you catch a pancake, and lose a point if it hits the floor.


Fireworks display

Make a fireworks display. Ideas:

  • A rocket flies up and explodes in the sky
  • A catherine wheel spins, putting out sparks
  • A kid waves a sparkler around
  • A fountain sprays up sparks from the ground

Hints:

  • You could use one sprite for a firework, and move it around or rotate it
  • Use different costumes on the firework, so it can change how it looks over time


YouTube tutorial: make a brick breaker game

Learn how to make a brick breaker game (try it out) by following along with this 32 minute tutorial.

Then change the game to make it cooler: make the bricks different colours, change the background, add sounds, or whatever you want.


Safari Park Visit

Make a story about going to the safari park. There should be a car which drives through an animal enclosure full of lions (or elephants, or whatever!). The car can stop, the animals can more around, and the car can move on.

  • When the car stops for everyone to look at the animals, people in the car could talk about the animals. You can use the 'say' command.
  • The car could drive through two or more enclosures, each with different animals in it. To show a new enclosure, wait for the car to drive across the screen, then change the background and the animals, and move the car back to the edge of the screen.
  • The animals could mess with the car. So the monkeys could throw bananas at it!


3 Little Pigs

Write the story of the "Three Little Pigs" (4 minute video of it here).

You will need a wolf sprite, a pig sprite, and houses of straw, brick and stone (the stone house has a chimney). You can then move the wolf and pig sprites around to tell the story. You can use "broadcast" blocks in the "Events" section to send messages between sprites, so one sprite can say/do something after another sprite is done. You'll need 3 scenes, one for each house. Here's what happens in each scene:

                    House of straw:
                    Wolf: "Little pig, little pig let me in"
                    Pig: "Not by the hair of my chinny chin chin"
                    Wolf: "Then I'll huff and I'll puff and I'll blow your house in!"
                    Wolf: blows house down, pig runs away

                    House of sticks:
                    Wolf: "Little pig, little pig let me in"
                    Pig: "Not by the hair of my chinny chin chin"
                    Wolf: "Then I'll huff and I'll puff and I'll blow your house in!"
                    Wolf: blows house down, pig runs away

                    House of bricks:
                    Wolf: "Little pig, little pig let me in"
                    Pig: "Not by the hair of my chinny chin chin"
                    Wolf: blows house, nothing happens
                    Wolf: "I'll get those pigs. I'll climb down the chimney"
                    Wolf: goes down chimney, lands on fire
                    Wolf: "Ow, ow, ow - I've hurt my bum!"
                    Wolf: wolf runs away
                    Pig: victory dance
                

Youtube tutorial: make a running dinosaur game

Learn how to make a "endless runner" type game, where a t-rex jumps over cactuses (try it out) by following along with this 17 minute tutorial. The starter project mentioned in the video is here. There is also a part 2 (23 minutes) to finish things off.


Youtube tutorial: make a platformer game

Learn how to make a platformer game, with multiple levels and collision detection (try it out) by following along with this 27 minute tutorial.


Beach Scene

Make a beach scene with Scratch. You will need a beach and some sea. Place interesting things in the scene like a sand castle, some shells, and a boat.

More advanced: add some animation so things move around. Ideas:

  • A crab scuttles around the beach
  • A sea gull flies through the sky
  • Clouds drift in the wind
  • People walk along the beach
  • A fish jumps out of the water


Jubilee Picnic

There’s a picnic in your street - yum! Your sprite needs to walk back and forth across the screen catching cakes, sandwiches and drinks. Set up a timer so that players have one minute to collect as many as they can. Set up a counter to count how many they can catch.

Hints:

  • Draw a sprite of yourself, with a plate. You will need two costumes: one for when you are walking left, and another for walking right.
  • Draw a cake, sandwich and fizzy drinnk sprite. To make them fall from the sky, set their original location to a random position at the top of the screen, then move their location down the screen. When they get to the bottom, move them back to the top.
  • An easy way to 'catch' a cake (or whatever) on your plate is to make the plate a special colour, then add an action to the cake sprite when it touches the special colour. So you could hide the cake, and add a point to the score.

Advanced

  • Add a second level with balloons. If any balloons hit the ground, they pop!
  • Add something that would spoil the picnic. If the player catches that item accidentally, a message flashes up “Time to go home!”

Make the threatre play "Macbeth"

Make a (short!) theatre play in Scratch. We'll show you how to make "Macbeth" by William Shakespeare. This is what happens:

  • There's a stage hidden by a curtain
  • The curtain goes up and shows the stage
  • There are some actors on the stage, who say some lines
  • The audience claps
  • The curtain comes down and hides the stage. The end.

Some hints to make the play Macbeth:

  • Your actors are 3 witches making a potion in a cauldron. You can find a witch sprite in the scratch sprite library. Or draw your own.
  • Sprites can speak with the ‘say’ command.
  • You can use "broadcast" and "message" blocks in the "Events" section to send messages between sprites, so one sprite can say/do something after another sprite is done. You can also use messages to make things in the play happen in order, like the curtain coming up before the actors say their lines.

Lines for the witches to say:

First Witch:
Double, double toil and trouble
Fire burn and cauldron bubble

Second Witch
Fillet of a fenny snake

Third Witch
In the cauldron boil and bake


Four Seasons

Make a picture of a wood - with trees, animals, a house, and a sky - then change it 4 times so it's winter, spring, summer and autumn.

Hints:

  • Give each woodland sprite (like a tree) 4 costumes - one for each season. So you could draw a tree once, copy it to get 4 costumes, then change each costume for a particular season. So the "winter" tree would have snow on it.
  • Let the user click a button or press the spacebar, and use that to change all sprites to use their next season's costume. So the sprites will change from winter to spring, and so on.

Advanced:

  • Add some animation to each season. So you could have falling snow in winter, flowers appearing in spring, sun in summer, and falling leaves in autumn.


Noisy Zoo

Make a zoo with various animals in it: an elephant, some monkeys, a tiger, and anything else you want. When you click on an animal, it should make a noise. So when you click on the tiger, it roars!

Getting started:

  • You will need some animal pictures. The Sprite Library has an “Animal” category with useful sprites in it.
  • You will need some animal noises. The Sound Library has some "Animal" sounds you can use. Or record your own! If you can't find the right sound, then just write it in a speech bubble: "rooooarrrr"!

More advanced:

  • Animate the animals when they make a sound. So the tiger could open its mouth wide when it roars. You would change the animal's costume to do this.
  • Add in some people visiting the zoo. When you click on them, they could say how they feel about the animals.


Beach Clean

Make a game called "Beach Clean", where you clean all bottles from a beach by clicking on them. You win when no bottles are left. Make the simple game first (instructions below), and then the real game.

For the simple game, show a beach with one bottle at a random location. When you click the bottle, it vanishes, and a "finished" screen appears. Instructions:

  • Make a sprite that looks like a bottle, or just pick any sprite from the library (and change it later).
  • When the game starts (the green flag is clicked), set the backdrop to a beach. Also set the bottle to a random location, and "show" it. To set the location, use the "got to x and y" block, together with the "pick random" block to set the x and y positions.
  • When the bottle is clicked, "hide" it and broadcast a message called "finished".
  • Listen for the "finished" message, and switch the backdrop to a green screen saying "FINISHED!"
  • Make the game cooler by adding sounds for when the bottle is clicked, and the game finishes. And make sure the bottle looks like a bottle.

Now for the real game. It's the same as the simple game, but we show lots of bottles, adding one bottle every second. The game finishes when the player clicks all the bottles. This game is harder to build, as it uses clones and variables. Instructions:
  • Make sure the simple game works.
  • We make lots of bottles by "cloning" the bottle sprite. When the game starts, "hide" the bottle sprite (and dont "show" it). Then add a "forever" block. Inside this block, "create a clone" of the bottle, and "wait" 1 second. Then..
  • Add a "when I start as a clone" block. In that block, "show" the clone bottle, and set it to a random location (use the "set x and y" block from the simple game).
  • In your "when this sprite clicked" block (from the simple game), make sure the bottle clone "hides", and add "delete this clone". AND MAKE SURE YOU REMOVE the "broadcast finished" block - FOR NOW.
  • The game should now show lots of bottles which vanish when clicked, but the game never finishes. Let's fix this with variables.
  • Add two variables called "bottles" and "running". "bottles" will count how many bottles are on the beach. "running" will be 1 when the game runs, and 0 when it's not.
  • When the game starts, set "bottles" to 0 and "running" to 1.
  • In the "when I start as a clone" block, change "bottles" by 1. In the "when the sprite is clicked" block (where you delete the bottle), change "bottles" by -1. So "bottles" now counts bottles on the beach. "bottles" will be 0 when the player has clicked all bottles. We can use this to finish the game.
  • We will stop the game when "bottles" is 0. In the "when this sprite is clicked" block, use an "if" block to check if "bottles" is 0, and broadcast "finished" to stop the game (and change to the "FINISHED" backdrop).
  • The last thing we need to do is stop creating new bottles. In your "when I receive 'finished'" block, set "running" to 0. Now find the code when the game starts where you create a new bottle using "create a clone" and wait 1 second. Make an "if 'running' > 0" block, and put the "clone" and "wait" blocks inside - so you only create new bottles when the game is running.
  • You should now have a working Beach Clean game - well done!


Santa Game: Drop Presents Down Chimneys

Follow along with this YouTube tutorial, and make a game where Santa drops presents down chimneys for points!

Mix and Match Body Game

Make a game that lets you mix and match body parts: make the strangest, funniest or coolest person by mixing different heads, body and legs.

To get started:

  • Make a single person out of 3 sprites stacked on top of one another: a head sprite, a body sprite (neck down to waist), and a legs sprite. So you will need to draw a head, a body and some legs.
  • Add some more heads to mix and match. Right now you have a head sprite with one "costume". "Duplicate" your first head costume, and mess with it to make a second costume. Try and keep it roughly the same size as the first, so it matches up with the body and legs.
  • Now use the same "duplicate" trick to make more body costumes, and legs costumes.
  • To get mix and match working, make each sprite clickable. Use the "when this sprite clicked" event, and make it switch to the next costume with the "next costume" block.
  • You should now be able to mix and match different people by clicking the head, body and legs sprites to get cool combinations. Have fun!

More challenging:

  • Add more head, body and legs costumes. You could add different animals, or superheros, or aliens! Make sure they are roughly the same size as your first person so that the heads / bodies / legs still match together.
  • Add a hat sprite on top of the head sprite, and add a bunch of hat costumes.


Animate the Coronation

Animate the Coronation of Prince Charles, where he is crowned King Charles III. We'll do the short version:

  • Make (or find) a sprite of Prince Charles standing up. It doesn't need to look like him.
  • Make a sprite of a throne - a big, fancy chair for Prince Charles to stand in front of.
  • Make 3 sprite of things Prince Charles needs (click each thing below to see a picture of it):
  • Now for the Coronation:
    • Prince Charles moves in front of the throne
    • The crown appears on Charles' head
    • The orb appears in Charles' hand
    • The sceptre appears in Charles' other hand
    • Charles says "I am King Charles III"
    • Someone else moves into view and says "God Save the King!"
    • The End

Hints

  • To get everything into its correct place at the start of the animation, move sprites to where you want them, and note down their x and y co-ordinates. Then on the "When Green Flag clicked" event, move the sprites to these co-ordinates.
  • Use "hide" and "show" to make sprites appear and disappear.
  • To make things happen in the right order, you can use messages (see the Events section). So Prince Charles could say "I am King Charles III" and broadcast the "king-crowned" message. And the onlooker sprite could use the "When I receive the 'kind-crowned' message to then say "God Save the King!"


YouTube tutorial: make a RPG game

Learn how to make an RPG (role-playing game) by following along with this 8 video playlist. Looks cool!


YouTube tutorial: make a Geometry Dash game

Learn how to make a Geometry Dash platformer game by following along with this 8 video playlist.

Making Websites


Before you start

If you’ve never built a website before, do our badge called Get your own website on the Internet. If you have built a website before, pick a challenge below and do it!


Challenge: The Solar System

Create a website about the solar system. It will need a start page describing the solar system, and a page about every planet. You could even do pages about different space missions involving astronauts.

Hints:

  • If you find a cool webpage on the internet (about space!), you can link to it from your website.
  • You could draw your own pictures of planets, or space-ships, or aliens.
  • Can you make the website feel like space by changing colours? You’ll need to change CSS.


Where I Live

Create a website about the place where you live. Let’s say you live in Stirling. Where is it? How old is it? What would you show someone who came to visit? What interesting things can you do there?

Getting started:

  • Create one web-page explaining what the site is about.
  • Now create extra pages about particular topics, and link to them from the main web-page.
  • You can link to other Internet web-pages that are interesting: like the Stirling wikipedia page.
  • Lots of drawings and pictures please! You can create your own or find some online (with ok licence).


Ideal Home

You will definitely will the lottery next week, so it's time to plan your ideal home. Make a website with a page for each room in your ideal home. A page should describe the room and what's in it - add pictures of things you'd like in it, or rooms in other houses that inspire you.

You could also draw a plan of the house, which shows all the rooms, and clicking on any room should take you to the correct page. Each room's page could also link to the other rooms next door.


Countries of Europe

Make a website about countries of Europe. Have a webpage about each country with lots of facts and pictures about it: the capital city, flag, population size, languages spoken, famous people born there, and so on. Then link to the webpages of geographically adjacent countries. So France would link to Belgium, Luxembourg, Germany, Switzerland, Italy, Monaco, Spain, and Andorra.


Christmas Challenge: I’ve been good!

What do you want for Christmas? Let Santa (and mum, dad, gran and anyone else) know with your own website.

Your website should have descriptions and pictures of the items you want and links to where they can be bought. You could prioritise the items with a star rating to say how much you want that item, or organise it by price so everyone can find the right gift for you!

More advanced: Add some Christmas style and Christmas tunes to get everyone in the present-buying mood!


Challenge: Science!

Chemistry, computing, psychology, microbiology, astronomy…. how many types of science can you think of?

Make a guide to science: your website should have one page for each type of science. Explain what it is. Include pictures of famous scientists or discoveries, and links to other websites so that your readers can find out more.


Halloween Challenge: Haunted House

Make a website game about a haunted house. Each webpage is a room in the house, and describes the spookiness happening in the room. The links on a room’s webpage take the player to other rooms nearby.

The player starts outside the haunted house (on the website’s main page). They then choose which links to follow to take them though the haunted house, and out the back door!


Challenge: Olympics

So you watched the Olympics? There were loads of cool sports: swimming, triathlon, fencing, …

Make a website about the Olympics. You can have pages about different sports and athletes. Maybe a page about Rio de Janeiro in Brazil. Include pictures and videos (try including a youtube video). Link to other websites where your readers can find out more.


Challenge: Animal Noises

Make a webpage with lots of animal pictures. When you click on a picture ("sheep"), an alert box should pop up with the animal noise ("baa").

This challenge involves adding some javascript to your webpage. You'll need to get two parts working (do some searching online!):

  • To make something happen when someone clicks on an image, you will need an onclick attribute
  • To popup the animal noise, you will need an alert box
More advanced:
  • When the animal image is clicked, play the actual animal sound! Try searching for play a sound on click for help on how to do this.


Challenge: Baker's Shop

Make a website for Bob's Bakery.

"My name's Bob, and I run Bob's Bakery. We make lots of cakes and tasty things: chocolate cake, gingerbread men, jam doughnuts, ring doughnuts, strawberry tarts, and lots more. I'd like to start selling my cakes on the internet, so will need a website. I reckon it needs:

  • A home page, all about Bob's Bakery and our cakes. We've been baking since 1917!
  • A page for each of the cakes we sell, with details of each cake: its name, picture, price, ingredients, and a big "buy" button
  • A "contact us" page, with the address and map of our shop. Our shop is actually inside the Wallace Monument! The address is: Abbey Craig, Hillfoots Rd, Stirling FK9 5LF
I'm looking forward to what you come up with :-) Thanks, Bob"


Challenge: My Favourite Films

I bet you've got a few favourite films. So make a website about them! You will need:

  • A front-place explaining that this is your film website, with links to web-pages about each film.
  • A web-page for each film. The page should contain (at least) the film's title, image and a short summary of what it's about. You could also review and rate the film. It is a 4-star or 5-star film?
  • You could also have web-pages about actors and actresses in these films.
  • Be careful with the pictures you use on your website: you may need permission to use some pictures you link to. Wikipedia has film images with 'fair use' permissions. For example, the Frozen wikipedia page has a image in the top right. Clicking on it shows a bigger image, with a "Share or embed this file" option in the bottom right. The 'embed' option has HTML that will show the image in a webpage.


Challenge: Bob the Builder

Make a website for Bob the Builder.

"I'm Bob the Builder. I build houses: houses for people, dog-houses, dolls-houses, tree-houses.. If it's a house, I can build it. I want a website so people can find me on the Internet, see what I do, and contact me if they're interested. Hopefully I'll get some new customers! I reckon the website needs:

  • A home page, all about me (Boy the Builder), and what I do (building houses).
  • A page showing previous houses I've built. For each house, it should explain what was done, and have a nice quote from the customer about what a good job I did!
  • A "contact us" page, with the address and map of my builder's yard. The yard is actually at the Wallace Monument! The address is: Abbey Craig, Hillfoots Rd, Stirling FK9 5LF
I'm looking forward to what you come up with :-) Thanks, Bob"


Challenge: my favourite game

My favourite game. Write a small website about your favourite game(s). The website should contain:

  • A short description of the game. What's it about? What are the goals of the game? How long does it take to complete? Is there a story? Who's it developed by? And any other relevant information.
  • A link to the game site
  • Images and videos of gameplay

Advanced

Pick a browser game you like and write a new page for it with all the details specified above. Also try and place the game in the webpage, so it's playable. Hint: lookup what an iframe is.


Selling your house

Imagine you are selling your house - make a website to promote it. To get an idea of what you need to show, look at this real estate agent website, and click on one of the houses for sale.

If you don't want to make a website for your real house, then just make a house up. You could pretend you were selling Stirling Castle!

The website should contain:

  • The address of the house, plus photos
  • The sale price
  • A picture of the house layout
  • A description of the house
  • The house location on Google Maps, if you can work it out

  • Rate my teacher

    Write a website about the teachers in your school. Each teacher should have their own page, describing what they teach, how much homework they give, how strict they are, what their classroom is like, etc. You could add a drawing of each teacher to help new pupils identify them. Don't forget the Head Teacher! You could arrange the front page so that the teachers are organised by subject.


    Best Memes Ever

    Make a website with the best memes ever. It should be possible to view memes by animal type, subject and year, so you'll need different web pages for this.


    Fun with Fonts

    How text appears on a webpage depends on which font is used. For example, we could use the Courier font, or Verdana font. Write a webpage that shows the same piece of text with different fonts: use the sentence "the quick brown fox jumped over the lazy dog". The text will feel different, depending on the font used. Try finding fonts that look official, funny, old or futuristic. What's your favourite?

    Getting started:

    • Work out how to use CSS to use a particular font for a piece of text. Try using the fonts that are built into your web browser.
    • You can find lots more fonts at Google Fonts. They also have a nice Getting Started guide.


    Make Stories With Twine

    Twine is an online tool for telling interactive stories. Here are two examples:

    Make your own story using Twine. It's easy to use once you get the hang of it. Here are some useful guides:


    Twine Story: A Day in the Life of Timmy the Dog

    Make a "Choose Your Own Adventure" story with Twine called "A Day in the Life of Timmy the Dog".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

                            Timmy the Dog is sniffing the rubbish bin outside his house. Suddenly he hears a rustle behind him, and
                            sees Sooty the Cat staring. Timmy:
    
                            * Walks up to Sooty, and tries to make friends.
                            * Bounces up to Sooty, and starts a fight. That cat needs a lesson.
                            * Runs awwaaaaay! Sooty is scary.
                        
    Each choice is a link to another page, where the story continues. So what happens when Timmy runs away, or starts a fight?


    Twine Story: The Three Little Pigs, as the Wolf

    Make a "Choose Your Own Adventure" story with Twine that's the classic story "The Three Little Pigs". (4 minute video of it here). You are the Wolf.

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

                            Dave the Wolf is hungry. He's learnt that 3 little pigs have moved into the area, and have built themselves
                            houses. Dave likes eating pigs. He heads for the first house, which strangely is made out of straw. Dave:
    
                            * Walks up to the door and knocks on it. Maybe the pig inside will answer.
                            * Finds a goat in the field next door, and leads it over to the straw house. Hopefully the goat
                              can eat through the wall.
                            * Climbs onto the roof, so he can climb down the chimney and surprise the pig.
                        
    Each choice is a link to another page, where the story continues. So what happens when Dave knocks on the door, or climbs up on the roof?


    Twine Story: The Magical Wardrobe

    Make a "Choose Your Own Adventure" story with Twine called "The Magical Wardrobe".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

    
    You and your Mum and Dad moved into the new house this morning. It's nice. Your first night in your new bedroom. You wake at 3am to a strange noise: a ringing coming from the attic.
    
    You quietly creep up into the attic, and find the ringing is coming from a big old wardrobe in the corner. You:
    
    * Panic, run down to your bedroom and hide under the covers.
    * Open the wardrobe. Let's get this adventure started.
    * Go wake up your Mum and Dad. They need to know.
    
    

    Each choice is a link to another page, where the story continues. So what happens when you open the wardrobe?


    Twine Story: Voice from the Postbox

    Make a "Choose Your Own Adventure" story with Twine called "Voice from the Postbox".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

    
    You're waiting for your Mum outside the Post Office - she's gone in to post a parcel. You lean against a big old red postbox. Suddenly you hear a voice. "Help!" it says. It's coming from inside the postbox. What's going on? You decide to:
    * Peer inside the postbox slot. Maybe there's someone stuck in there
    * Ignore the voice. You're imagining things. No-one could be inside a postbox!
    * Run inside the Post Office to see your Mum. She'll know what to do.
                    

    Each choice is a link to another page, where the story continues. So what happens when you peer inside the postbox?


    Twine Story: The Vault Robbery

    Make a "Choose Your Own Adventure" story with Twine called "The Vault Robbery".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

    
    You are a master jewel thief. You have tunnelled into a vault full of gold and diamonds underneath a famous jewellery shop in London. It is Saturday night, midnight, all quiet. Time to rob the vault.
    
    You step into the vault for the first time, and see piles of gold bars ahead of you. Suddenly an alarm on the ceiling above starts ringing. You:
    
    * Run away! You must have been discovered.
    * Ignore the alarm. You have a plan, and should stick to it. Maybe it's just a smoke alarm.
    * Try cutting the wires running to the alarm. Maybe that will stop it.
                    
    

    Each choice is a link to another page, where the story continues. So what happens when you ignore the alarm?


    CSS Selectors Game

    Complete the CSS Selector Game, to learn about CSS selectors. It's got 32 levels, so should take some time!

    If you're not clear on what a CSS selector is, you might want to do one of these courses first:


    Easter Traditions

    Make a website about different Easter traditions around the world - a page for each one. For example, eggs are rolled down hills in the United Kingdom, whilst Spain holds processions to celebrate Semana Santa (Holy Week). Use pins on Google Maps to show where each tradition happens.


    Colour Codes

    CSS lets you write text and backgrounds in different colours. Write a webpage that shows the same piece of text with different background and text colours: use the sentence "the quick brown fox jumped over the lazy dog". Use a large font size so you can get a good look at the colours. Choose colour combinations that are readable. Which combinations don't work together, and why? What's your favourite?


    Welcome to Paris

    It's the summer holidays. Are you going somewhere nice? Paris? Ooh la la!

    Imagine you're the Paris Tourist Board (or any other holiday destination). Make a website for tourists visiting Paris. You will need:

    • A front page saying "Welcome to Paris", with nice pictures, and links to other pages covering...
    • Things to do in Paris, listing tourist attractions
    • Where to stay in Paris, listing hotels
    • How get to Paris, explaining flights and trains
    • And any other webpages that might be useful to a tourist


    School Sports Day

    Love it or hate it, your school sports day is just around the corner. Create a webpage guide to the day.

    Make it serious, with a page to explain each competition and notes about how the long jump, hurdles and shot-putt are scored.

    Or make it silly, with top tips for winning the egg-and-spoon race, pictures of three-legged disasters, and tales of how your little brother crashed out of the sack race last year.

    You’ll need a page for each competition.


    Introduction to Scratch

    Make a website telling people about Scratch: what it is, and what you can do with it.

    You can link to Scratch games and stories you like. If you've made some Scratch games and stories yourself, then link to them as well, and write down what was interesting or challenging about making them.

    Show off your Scratch knowledge!


    Codecademy course: Learn Javascript

    Javascript is the coding language used to make websites interactive and whizzy. Take a look at the free Codecademy "Introduction to Javascript" course.


    Your Christmas present wish list

    Create a website for your Christmas present wish list. Lay all the details out neatly in a table. You could have a column for the presents, another column for where to buy them from and another for options like colour . Give your website a nice big title. Add a bit of sparkle with an animated background made from images you find about Christmas.


    Cat Meme Generator

    Make a Cat Meme Generator by following along with this tutorial.

    After that: the Cat Meme Generator tutorial comes from the Raspberry PI website, which has a bunch of other html+css projects. Try them out.


    Warm weather website

    Create a website about the warm weather we are having. Why is the weather so warm when we had deep snow in February last year? Is it global warming or is it just chance.

    Add a bright title.

    Search the internet for information about weather variation to include on your website. Add some pictures of February weather in Scotland

    Add some visual effects to enhance the weather theme.


    Make an animated GIF

    Animated GIFs are fun small videos designed for the internet, like this one

    You need a few pictures to join together to form the video.

    You can make pictures using Scratch:

    • Open a sprite in the "Costumes" editor
    • You can save a sprite's costume to a picture file by right-clicking on its little picture, and choosing "export".

    You can then combine your pictures into an animated gif using giphy.


    Learning layout

    Boxes, borders, position and padding: these are all parts of CSS which are used to layout parts of a webpage. Follow along with this tutorial to explore how layout works and how webpage elements are controlled with CSS. Have a play with the examples.


    Codecademy course: Introduction to HTML

    Take a look at the free "Introduction to HTML" course at Codecademy.


    Holiday Reading

    You've just had seven weeks holiday... did you get bored at all?

    Make a website about all the great stuff you did, to keep others from getting bored next summer. You could include pages about:

    • Books they're going to love
    • Games they should play
    • Cool things they could make
    • Stuff to do outdoors
    • Ways to drive their brother or sister crazy ;-)
    Make sure you include pictures, videos, and links to other websites.


    Webpage links

    Links on webpages are usually blue and underlined, and change to purple once clicked. CSS styles let us change this - we can choose how links are displayed. Let's play around this:

    • Setup a blank web page with html, head and body elements.
    • Add a style element inside the head element.
    • Inside the style element, add styles for links in different states. Normal links are referred to as a:link, links that have just been clicked as a:active, links that have been clicked before as a:visited, and links that the mouse is hovering over as a:hover.
    • For each type of link, you can add styles for foreground colour (like: color: red), background colour (like: background-color: transparent) and text effects (like: text-decoration: bold)
    • Add links to the body of the web page, and see how they're affected by the CSS styles

    Your inline style might look like this:
                <style>
                a:link {
                    color: green;
                    background-color: transparent;
                    text-decoration: none;
                }
                a:visited {
                    color: pink;
                    background-color: transparent;
                    text-decoration: none;
                }
                a:hover {
                    color: red;
                    background-color: transparent;
                    text-decoration: underline;
                }
                a:active {
                    color: yellow;
                    background-color: transparent;
                    text-decoration: underline;
                }
                </style>
                


    My Holiday web form

    Web forms allow someone visiting your website to type in some information. Clever websites can do exciting things with this information like calculating how many Dollars you can get in exchange for a Pound.

    Follow this tutorial to see how web forms work.

    Create your own web form for users to enter information about their holiday. You could use text fields so users could say where they went and for how long. Use selection buttons so users can say whether they traveled by train, car or aeroplane. You could use a drop down list so users can rate their holiday out of 5 (a different entry for 1 star, 2 stars, etc).

    More advanced: Style your form to make the form elements look more attractive.


    Christmas food

    Food. Lots of it. That's what Christmas is all about, right?

    Make a website to showcase all the scrummy food you look forward to at this time of year. Create a page for each dish, and link them together. You'll need pictures, recipes for how to make it, and a bit of a story about why you love it or when you have it. Make sure you use plenty of Christmassy styling on the pages too.


    Twine Story: The Power Went Out

    Make a "Choose Your Own Adventure" story with Twine called "The Power Went Out".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

                       You are home alone, watching TV. Suddenly you hear a loud bang in the distance, and the power goes
                       out. The TV goes black, and the streetlights switch off outside. You:
    
                       * Stay on the sofa eating crisps. Hopefully the power will come back on soon.
                       * Get your shoes on and head for the door. That loud bang needs investigating.
                       * Go find candles and matches in the kitchen drawer. The power might be off for a while.
                    
    Each choice is a link to another page, where the story continues. So what happens when you go outside? Or if you stayed on the sofa, did the power come back on?


    Twine Story: No Door Key

    Make a "Choose Your Own Adventure" story with Twine called "No Door Key".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

                        You're having a bad day. You live on a farm miles from the nearest village. It's January, and it
                        snowed deep this morning. Coming home from school, the school bus struggles through and drops you
                        off on the main road. You walk the half-mile to the house. Turns out Mum and Dad have left to handle
                        an emergency with Gran. Mum says they'll be back tomorrow, so you should let yourself in and make
                        dinner. Except you forgot the house door key, and it's getting cold and dark. You:
    
                        * Take a look in the greenhouse. There might be a spare key hidden there.
                        * Give the back door a kick. Desperate times mean desparate measures. Maybe you can kick the door open
                        * Walk back to the main road. Maybe you can get some help
                    
    Each choice is a link to another page, where the story continues. So what happens when you look in the greenhouse? Or when you walk back the the road in the the cold and dark?


    Shopping Street

    Make a website about a street in your town with lots of shops and cafes. For each shop/cafe, add a description, a photo (if you have one), and links to their website, facebook page, etc. To make it interesting, you could lay the webpage out like a map of the street, and lay the shops' details out on the map.


    Months of the Year

    Make a website about the months of the year. Have a main page, with links off to other pages: one for each month of the year. On a month page - like "January" - explain where the month name comes from, important events that happen in that month, pictures of scenes from that month, and anything else you think is interesting.


    Twine Story: Christmas Day

    Make a "Choose Your Own Adventure" story with Twine called "Christmas Day".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

                        You wake up cozy, under the covers in bed. There's a filled stocking at the end of your bed - Santa's
                        been! You also hear Mum downstairs, making a cup of tea. You:
    
                       * Grab the stocking and talk a look. What did Santa bring?
                       * Put your slippers on and head downstairs to say "Merry Christmas" to Mum.
                       * Go back to sleep. Sleeping is nice.
                    
    Each choice is a link to another page, where the story continues. So what happens when you go downstairs? Or if you grabbed the stocking, what's in it?


    Santa and his Reindeer

    Make a "did you know" website about Santa and his reindeer. Have a main page about Santa and his sleigh, delivering presents on Christmas Eve. How many presents do they deliver? Who do they deliver them to? How fast does the sleigh go? Then link to different sub-pages about just Santa, and each of his reindeer (Rudolph, etc). You can add silly biographies about each of the reindeer, and pictures, and anything else you want! Can you embed a YouTube video with the 'Rudolph the Red Noise' reindeer song?


    Learning to Code

    Make a website about learning to code - you could base it on what you've learnt so far. Have pages about different areas like Scratch, HTML and CSS, real coding languages like Python and Javascript, and hardware like Microbits and Raspberry Pi. Each page could explain what each area is, and the important ideas. It could also link to other pages on the internet that are useful. So the Scratch page could have links to Youtube tutorials, or to Scratch games that you like.


    The Coronation

    Make a website about the Coronation of King Charles III. You'll need a 'welcome' start page, with links off to different topics. Some topic ideas, each on a different webpage:

    • Prince Charles: when he was born, his full name, what he's done..
    • What the Coronation is about, and what happens
    • Coronation themed food recipes


    Twine Story: Stealing the Crown Back

    Make a "Choose Your Own Adventure" story with Twine called "Stealing the Crown Back".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, this is the first page:

                    The King is angry. Darksmoke the Dragon has stolen the King's crown. You have tracked Darksmoke back to
                    his lair in a dark cave under the mountains. You hide behind a boulder, watching Darksmoke sleep on a
                    pile of treasure. The King's crown is next to the dragon's tail. You sneak forward, ready to take back
                    the crown. Darksmoke sneezes in his sleep and moves his tail. You:
    
                    * Freeze. Maybe Darksmoke will settle down again and you can move forward
                    * Speed up. Let's get that crown back before Darksmoke wakes up.
                    * Panic and run back to the boulder. You must have woken Darksmoke up!
                    
    Each choice is a link to another page, where the story continues. So what happens if you panic? Or if you speed up and grab the crown?


    Twine Story: Broken Ankle

    Make a "Choose Your Own Adventure" story with Twine called "Broken Ankle".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, this is the first page:

                    You are walking home from school through the wood. The path is slippy with mud. Suddenly you slip and
                    fall over down a slope off the path. You try to stand up but can't. Your ankle is really sore, and it's
                    at a funny angle. Maybe it's broken. What do you do?
    
                    * Get on your knees and crawl up to the path, gritting your teeth through the pain
                    * Stay where you are - if you move, you might hurt your ankle more
                    * Search through your school bag. Did you remember your phone today?
                    
    Each choice is a link to another page, where the story continues. So what happens if you stay where you are? Or did you remember your phone?


    Twine Story: Hot Sticky Tar

    Make a "Choose Your Own Adventure" story with Twine called "Hot Sticky Tar".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, this is the first page:

                    You are walking home from gran's house. You're running late for dinner so check your phone - and suddenly you
                    can't move! You just walked straight past a roadworks sign, and into some hot sticky tar! Looks like the
                    pavement was being fixed today.
    
                    You try moving your feet, but you're stuck up to your ankles. What do you do?
                    * Look in your school bag. Maybe there's something you can use to help get you free.
                    * Stay where you are. Maybe someone will come along and help.
                    * Yell for help. Surely someone will hear you.
                    
    Each choice is a link to another page, where the story continues. So what happens if you stay where you are? Or can you dig out your feet?


    Twine Story: An Open Door

    Make a "Choose Your Own Adventure" story with Twine called "An Open Door".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, this is the first page:

                    Anya slammed the door behind her and ran across the field behind her aunt’s house. She could hear Aunt
                    Molly’s voice yelling after her as she ran, and tears were streaming down her face. When she reached the
                    woods on the far side of the field, Anya stopped and looked around. Among the trees, there was a tiny,
                    half-ruined house. But the door was standing open, and from inside there wafted a strange and delicious
                    smell.
    
                    What will Anya do?
                    * Go to the door and step inside.
                    * Call out, “Hello?” and wait to see who answers.
                    * Catch her breath, and trudge back across the field to the house.
                    
    Each choice is a link to another page, where the story continues. So what happens if Anya goes in? Or if she goes back and faces her angry Aunt Molly?


    Twine Story: Halloween Flat Tyre

    Make a "Choose Your Own Adventure" story with Twine called "Halloween Flat Tyre".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, this is the first page:

    
    Brad and Janet are driving in their car to see their old school teacher Mr Scott on Halloween.
    It's night time and raining hard. Suddenly the car feels bumpy and there's a funny noise.
    It's a flat tyre. Brad stops the car on the side of a country road. There is a spooky looking
    castle in the distance.
    
    What will Brad and Janet do?
    * Get out and run to the castle. Maybe they can get help there.
    * Stay in the car and get some sleep. They can get help in the morning.
    * Get out of the car and wait under a tree. Maybe a car will come along that can help.
                    

    Each choice is a link to another page, where the story continues. So what happens if Brad and Janet go to the castle? Or do they stay in the car and wait until morning?


    Twine Story: Spanish Singer

    Make a "Choose Your Own Adventure" story with Twine called "Spanish Singer".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

                        It's too hot to sleep. Your little sister seems to have dozed off at last but even with the doors
                        wide open to the balcony of your hotel, there is no breeze. The sound of strange insects buzzes and
                        hums in the Spanish night air. As you toss and turn, you become aware of a voice right outside,
                        singing a sad song in the darkness. You are alarmed, but curious: there shouldn't be anyone outside
                        your room. Do you:
                        * Switch the light on, waking your sister, and yell at the singer?
                        * Sneak over to the door and watch, to find out who it is and what they are doing here?
                        * Put on your shoes and slip quietly out onto the balcony?
                    
    Each choice is a link to another page, where the story continues. So what happens if you at the singer? Or do sneak out and find out more?


    Twine Story: Cat Tree Rescue

    Make a "Choose Your Own Adventure" story with Twine called "Cat Tree Rescue".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, your first page might look like:

                    You are walking home from the shops. It's getting dark. Suddenly you hear a panicked "miaow miaow" from
                    above. There is a young cat struggling to keep its balance high up in a tree. You:
    
                    * Keep walking. You want your dinner and the cat will surely be fine
                    * You start climbing the tree. Maybe you can put the cat in your backpack to get it down the tree
                    * You look around for something long to point up the tree. Maybe the cat can grab on and slide down to the ground
                    
    Each choice is a link to another page, where the story continues. So what happens the cat? Does it get down the tree in one piece?


    Twine Story: The Coronation Crown Heist

    Make a "Choose Your Own Adventure" story with Twine called "The Coronation Crown Heist".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, this is the first page:

                    You are Police Inspector Smith of Scotland Yard, in London. You have
                    learned that a gang of thieves are going to steal the Royal Crown from
                    Westminster Cathedral, ahead of the Coronation of King Charles III.
                    You must stop them.
    
                    At 7am you climb onto a roof opposite Westminster Cathedral, and use
                    binoculars to watch the crowds below as people start to gather. At 7:20am,
                    you see a familiar face in the crowd: one of the thieves. You:
    
                    * Run down the stairs and chase after the thief. Only you can stop him.
                    * Stay on the roof and keep watching the crowd. That thief was likely a decoy.
                    * Radio to a police officer at the Cathedral entrance to watch out for the thief.
                    
    Each choice is a link to another page, where the story continues. So what happens if you chase the thief? Or if you stay on the roof and look for other suspicious characters?


    Twine Story: Santa Rescue

    Make a "Choose Your Own Adventure" story with Twine called "Santa Rescue".

    If you don't know how to use Twine to make stories, then do the "Make Stories with Twine" challenge first.

    To start you off, this is the first page:

    
    You go to sleep all excited on Christmas Eve - what presents will Santa bring? At 3am you wake up needing a pee. You
    head to the bathroom, but hear some noises from downstairs. You tiptoe down to the living room, and peer in. There's a
    pair of red-trousered legs dangling out of the chimney! With black boots on! It must be Santa. He's stuck up the chimney.
    "Help!" says a muffled voice.
    
    What do you do?
    * Grab the legs and pull down. Maybe you can pull Santa out.
    * Run away and hide under the covers. Rescuing Santa is too much responsibility. Plus he's magic. He can sort himself out.
    * Wake up your parents. They will know what to do.
                    
    Each choice is a link to another page, where the story continues. So what happens when you pull on Santa's legs? Or if you wake up your parents?

    Coding (in Python or Javascript)


    Before you start

    If you’ve never coded in Javascript or Python before, do our coding badges to get started.

    If you have coded in Javascript or Python before, pick a challenge below and do it!

    Here are two online environments where you can start coding immediately (or use whatever setup you want):


    Challenge: Reversing Names

    Write a program that asks someone their name, then outputs it in reverse. So “GREG” becomes “GERG”.


    Challenge: Capital Cities

    Write a program that asks for a country name, then outputs the capital city. So “France” returns “Paris”.

    Getting started:

    • Start off with just 3 known country/capital combinations: get the information from wikipedia.
    • You’ll need to handle an unknown country being entered: just return “unknown country”.

    More advanced:

    • Expand to lots of countries. Considering using the ‘hash table’ data structure.
    • Can your program handle “ fRanCE “, and still return “Paris”?
    • Can your program do the reverse, so “Paris” returns “France”?


    Challenge: Rock Paper Scissors

    Write a program that plays ‘rock paper scissors’:

    • Ask the player to pick ‘rock’, ‘paper’ or ‘scissors’
    • Have the computer choose its move (get it to make a random choice)
    • Compare the choices and decide who wins
    • Print the results

    More advanced:

    • Let the player play again.
    • Keep a record of the score e.g. (Player: 3 / Computer: 6)


    Hangman

    Write a program that plays ‘hangman’. The player guesses letters to complete a secret word. You decide how many turns they get. On each turn:

    • The player guesses a letter
    • The computer prints out the word, but shows ‘@‘ for letters not guessed yet. So if the word was ‘dog’ and the player had only guessed ‘d’, the computer would show: ‘d@@’
    • If the player has guessed all letters in the word, it prints the whole word and ‘you won!’
    • If the player hasn’t won, the computer prints ‘number of turns remaining: ___’, and the player has another go.


    Draw 2d shapes in Python with Turtle

    Turtle is a well known graphics library for drawing in Python: you "drive" an imaginary turtle around to draw 2d shapes programmatically.

    Give Turtle a try and draw something:


    Challenge: Sentence Analyser

    Write a program that counts the number of words in a sentence. For example, for “i am an example sentence”, the program would print 5 (words).

    Then improve your sentence analyser:

    • Print out the total number of vowels in the sentence. So we’d print 9 for the example.
    • Print out counts for each vowel. For the example sentence, there is 1 ‘i’ and 3 ‘a’s and 5 ‘e’s.
    • Make sure your program works for lowercase and uppercase letters. So ‘A’ and ‘a’ should be treated the same. The phrase ‘A cat’ has two vowels, which are both the letter ‘a’.


    Challenge: Calculator

    Write a calculator that can add, subtract, multiply or divide two numbers. Make the calculator accept the two numbers and command one line at a time. Like:

    • 2
    • +
    • 3
    • And then the calculator outputs 5

    More advanced: make the calculator accept everything on one line, like: 2 + 3.


    Challenge: Fizz Buzz

    Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print “FizzBuzz".


    Challenge: Fibonacci

    Write a program that prints out the first 100 numbers in the Fibonacci sequence. In the Fibonacci sequence the first two numbers are zero and one. Every number after that is the sum of the previous 2 numbers. So the first seven numbers are: 0 1 1 2 3 5 8.


    Challenge: Secret Spy Messages

    Write a program that turns a sentence into a secret message by replacing each letter with the next letter. So the letter ‘a’ is replaced by ‘b’, and ‘f’ by ‘g’, etc. Here’s an example:

    • Original sentence: ‘attack at dawn’
    • Secret message: ‘buubdl bu ebxo’

    Hint: letters are represented inside a computer as numbers. This is called ASCII: so an ‘a’ in ASCII is 97. You’ll need to convert the sentence letters into ASCII, do some addition, then convert them back again. Google to learn about ASCII, and how you convert letters to ASCII (and back again) in your particular programming language.

    More advanced: so you’ve written a program that ‘encrypts’ a sentence into a secret message. Write a ‘decrypt’ program that turns a secret message back into the original sentence.


    Challenge: Anagram Detector

    Write a program that outputs whether two phrases are anagrams of one another. For example:

    • "Clint Eastwood" is an anagram of "Old West Action"
    • "parliament" is NOT an anagram of "partial man"

    Getting started:

    • Start off with a program which asks for two phrases, then outputs the result like above
    • Here are some examples to test your program with:
      Anagrams:
      • "wisdom" and "mid sow"
      • "Seth Rogan" and "Gathers No"
      • "Schoolmaster" and "The classroom"
      • "Vacation Times" and "I'm Not as Active"
      Not anagrams:
      • "Reddit" and "Eat Dirt"
      • "Astronomers" and "Moon starer"
      • "Dormitory" and "Dirty Rooms"
    • Thanks to Reddit dailyprogrammer


    Challenge: Reverse Factorial

    Write a program that outputs whether a given number is a factorial (or not).

    A factorial of a particular number is that number multiplied by all numbers below it. So 5! (meaning 5 factorial) = 5 * 4 * 3 * 2 * 1 = 120.

    Calculating 5! is easy. But we want to reverse this. Write a program that tells us that "120" is "5!". The program should work for any number, either reporting that that the number is a factorial, or "NONE" if it isn't. For example:

    • 120 = 5!
    • 150 NONE

    Getting started:

    • Hint: divide the input number by successively larger numbers until you get to "1" as the result: 120 -> 120/2 -> 60/3 -> 20/4 -> 5/5 -> 1 => 5!
    • Here are some examples to test your program with:
      Challenge input:
      • 3628800
      • 479001600
      • 6
      • 18
      Challenge output anagrams:
      • 3628800 = 10!
      • 479001600 = 12!
      • 6 = 3!
      • 18 NONE
    • Thanks to Reddit dailyprogrammer


    Challenge: To-do list

    Write a program that lets you create and manage a 'to-do list'. You should be able to: add an item, delete an item, and view the whole list (of items). Here's my example to-do list:

    1. Assemble an army of dolphins that will do as I command
    2. Use dolphin army to achieve world domination
    3. Eat chocolate chip ice cream with sprinkles on top

    Getting started:

    • When the program starts, it should ask the user what to do: the user enters an alphabet letter to select an option. So it could be 'a' for add, 'd' for delete, and 'l' for list, and 'e' for exit program.
    • Code 'add an item': the user should enter the item to add (e.g. 'Eat chocolate chip ice cream with sprinkles on top').
    • Code 'view list': show all the items the user has entered.
    • Code 'delete an item': the user should enter the list item to delete (numbering list items will make it easier to select one)


    Reaction Time

    Write a game that measures your reaction time: how fast you hit the space-bar when told 'hit it!'. At the end of the game, show your reaction time in milliseconds (a second divided into 1000 parts). What's your fastest reaction time?

    Getting started:

    • When the program starts, show instructions explaining the game, and get the user to hit space-bar when they're ready to begin.
    • Wait say 5 seconds, then output "Hit it!" and start a timer.
    • When the user hits the spacebar, stop the timer.
    • Output the timer result (the reaction time).

    More advanced:

    • Make the player pay attention: randomise the time at the game start before outputting "Hit it!"
    • Tell the player off if they hit the space-bar too early (before "Hit it!").
    • Let the player have multiple goes, and calculate their average reaction time.
    • Make the game more interesting by getting the user to enter a random letter between 'A' and 'Z', rather than the space-bar.


    Challenge: Insult Generator

    Make a program that generates random insults :-) The program first asks for your name, then insults you. Here goes..

    • "What's your name?"
    • "Greg"
    • "Hi Greg. You eat like a greasy baboon!". Or maybe "Hi Greg. You run like a purple hippo!"

    Getting started:

    • When the program starts, ask the user for their name, then say hello ("Hi Greg").
    • Generating the insult is the tricky bit. Each insult is a sentence with the same structure: "Hi (Greg - name). You (eat - verb) like a (greasy - adjective) (baboon - noun). So we'll generate the insult by randomly picking a verb, adjective and noun, then making a sentence out of them:
      • Make a list of verbs. How about: eat, run and swim.
      • Make a list of adjectives. How about: greasy, smelly, grumpy.
      • Make a list of nouns. How about: baboon, cardboard box, dolphin.
      • Now we'll generate the insult by randomly picking a word from each of the three lists, and combining them into a sentence.
      • Go make some fun insults!

    More advanced:

    • Make the insults more complicated and longer. Use bigger lists of verbs, adjectives and nouns.
    • Why stop with random sentence generation - try random story generation! Use the same approach, but your lists are now of whole sentences rather than single words. So define the story's standard structure, then randomly fill in story gaps with randomly picked sentences:
      • I was born (in Paris, under an autumn sky | with a tail | 3 days early).
      • My mother (ate chips all day | loved to dance | howled at the moon).
      • All I could do was (vacuum the cat | take up break dancing | cook bacon and eggs).


    Triangles

    Write a small program that takes in a number and then prints off a triangle of that height. Here is an example:

                      Please enter the height of the triangle:
                      5
    
                      Output:
                               #
                             ##
                           ###
                         ####
                       #####
                    

    The program should only accept whole numbers between 3 and 10.


    Advanced version

    Once you've finished the basic version, try and produce the following output:

                        Please enter the height of the triangle:
                        5
    
                        Output:
                                  ##
                                ####
                              ######
                            ########
                          ##########
    
    
                      


    Greedy shopkeeper

    Write a small program that takes an amount of change, and then works out the minimal coins required to make it. You may only use the: 50, 20, 10, 5, 2, and 1 pence coins.

    Example

                      Input:
                        0.73
    
                      Output:
                        1 x 50
                        1 x 20
                        1 x 2
                        1 x 1
                    

    The program should only accept positive numbers and the input must never be bigger or equal to one.

    Advanced

    • When formatting the output avoid using string concatenation (i.e. "str1, " + "str2" becomes "str1, str2"), instead look up how to use .format() in python or `` (the grave accent) in JS.
    • Let the program accept inputs bigger than one. Now you may use the one and two pound coins. As well as the previous coins.

    School timetable manager

    So you're going back to school. Write a program that manages your school timetable. It should record which subjects you take during your school day. E.g.:

    • MON-PERIOD1: CHEMISTRY
    • MON-PERIOD2: ENGLISH
    • MON-PERIOD3: MATHS
    • MON-PERIOD4: ART
    • MON-PERIOD5: GEOGRAPHY
    • MON-PERIOD6: PE
    You can then ask the program what subject you have for a particular day+hour.

    Example

                      Input:
                        MON-PERIOD2
    
                      Output:
                        ENGLISH
                    

    Advanced

    • Make the program print the entire week timetable, nicely formatted.
    • For a given subject, make the program print out every period in the week when you take that subject.

    Driving Theory Test

    Getting your driving licence requires you to pass a "theory test". Write a program that lets you practice the theory test: the program asks you a set of multiple-choice questions, tells you whether you correctly answered each question, and tells you your final score at the end. Here's an example question:

    You will find that driving smoothly can:

    1. reduce journey times by about 15%
    2. increase fuel consumption by about 15%
    3. reduce fuel consumption by about 15% (correct answer)
    4. increase journey times by about 15%
    When presented with this question, the user types in the number of the answer they think is correct (e.g. 1 - incorrect). The program then states whether the user is correct or not, and moves onto the next question.

    Hints

    • You'll need to find some practice questions. The UK government website has some.

    Advanced

    • Time how long someone took to complete the test, and tell them on test completion.
    • Write another program that asks multiple-choice questions for a different topic. Try and share as much code as possible between the two programs.

    Speaking Clock

    Write a program that takes a time in 24 hour numeric form, and outputs it as words.

    Challenge input:

    • 00:00
    • 01:30
    • 12:05
    • 14:01
    • 20:29
    • 21:00
    Challenge output:
    • It's twelve am
    • It's one thirty am
    • It's twelve oh five pm
    • It's two oh one pm
    • It's eight twenty nine pm
    • It's nine pm

    Advanced

    Can you make the computer actually speak the time as words, so you have a real speaking clock?

    Thanks to Reddit dailyprogrammer


    Twelve Days of Christmas

    Write the smallest possible program to print all the lyrics to the "Twelve Days of Christmas":

                    On the first day of Christmas my true love sent to me:
                    a Partridge in a Pear Tree
    
                    On the second day of Christmas my true love sent to me:
                    two Turtle Doves
                    and a Partridge in a Pear Tree
    
                    On the third day of Christmas my true love sent to me:
                    three French Hens
                    ...
                    

    Hints

    To start with, get things working by using numbers (rather than words) for the gift counts:

                    On the second day of Christmas my true love sent to me:
                    2 Turtle Doves
                    and 1 Partridge in a Pear Tree
                    

    Advanced

    • Load all the gifts ("Turtle Doves", "Partridge in a Pear Tree", ..) from an input file, so you can change them easily.
    • Can you get the computer to play the melody of Twelve Days Of Christmas as well?

    Thanks to Reddit dailyprogrammer


    How Long Was The Light On?

    There is a light that switches on when someone enters the room, and switches off when they leave. If multiple people are in the room, the light stays on until the last person leaves. Write a program that outputs how long the light stays on, given a list of when people entered and left the room.

    Challenge input:

    • 1 3 (so person arrived at 1 o'clock, and left at 3 o'clock)
    • 2 3
    • 4 5
    Challenge output:
    • 3

    More input and output:

                    Input:
                    2 4
                    3 6
                    1 3
                    6 8
    
                    Output: 7
                    
                    Input:
                    6 8
                    5 8
                    8 9
                    5 7
                    4 7
    
                    Output: 5
                    

    Advanced

    Can you change the program to work with more precise times? E.g 09:00 09:25.

    Thanks to Reddit dailyprogrammer


    L33T SPEAK

    Write a program that translates English into Leet Speak (or vice versa). Examples:

    • BASIC => 6451C
    • ELEET => 31337 (pronounced elite)
    • WOW => `//0`//
    • MOM => (V)0(V)
    Use the following l33t:
                            A -> 4
                            B -> 6
                            E -> 3
                            I -> 1
                            L -> 1
                            M -> (V)
                            N -> (\)
                            O -> 0
                            S -> 5
                            T -> 7
                            V -> \/
                            W -> `//
                        
    The program takes in one word or phrase per line, and converts it to (or from) l33t:
    • 31337 -> eleet
    • storm -> 570R(V)

    Challenge input:

                    I am elite.
                    Da pain!
                    Eye need help!
                    3Y3 (\)33d j00 t0 g37 d4 d0c70r.
                    1 n33d m4 p1llz!
                    
    Challenge output:
                    I am elite. -> 1 4m 37173
                    Da pain! -> D4 P41(\)!
                    Eye need help! -> 3Y3 (\)33D H31P!
                    3Y3 (\)33d j00 t0 g37 d4 d0c70r. -> Eye need j00 to get da doctor.
                    1 n33d m4 p1llz! -> I need ma pillz!
                    

    Thanks to Reddit dailyprogrammer


    Noughts and Crosses

    Code the game of 'Noughts and Crosses':

    • Write a 2 player version first, with each player entering their move one after the other. Use ASCII art to show the state of the board, with board locations specified as in chess (like b3).
    • Write a one player version next, so you will need to write a basic arificial intelligence :-)

    Example

                        a   b   c
                      |---|---|---|
                    1 |   |   |   |
                      |---|---|---|
                    2 |   |   |   |
                      |---|---|---|
                    3 |   | X |   |
                      |---|---|---|
    
                      Player one, you are noughts. Enter your move: b2
    
                        a   b   c
                      |---|---|---|
                    1 |   |   |   |
                      |---|---|---|
                    2 |   | O |   |
                      |---|---|---|
                    3 |   | X |   |
                      |---|---|---|
    
                      Player two, you are crosses. Enter your move:
                    

    Seconds Convertor

    Write a program that converts a number of seconds into years/months/weeks/days/hours/minutes/seconds. Assume that there are 365 days in a year, and 28 days in month.

    Examples:

    • 1234567 => 14 days, 6 hours, 56 minutes, 7 seconds
    • 145252000 => 5 years, 1 day, 3 hours, 46 minutes, 40 seconds


    Battleship

    Write a 1-player version of the game 'Battleship'. Start with the simple version:

    • The game board is a 10 by 10 grid of squares, representing the sea.
    • When the game starts, 4 submarines are randomly placed on the board, on 4 different squares. None are visible to the player.
    • On the player's turn, they specify a board square they wish to "shoot". The board square is updated with their shot, and the player is told if they "HIT" or "MISSED" a submarine. For a "HIT", the square character is set to "x". For a "MISS", it is set to a "~"
    • The game finishes after 40 turns, or earlier if the player destroys all submarines.

    Example

                        a   b   c   d   e   f   g   h   i   j
                      |---|---|---|---|---|---|---|---|---|---|
                    1 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    2 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    3 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    4 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    5 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    6 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    7 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    8 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    9 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    10|   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
    
                      Player, enter your move: d2
    
                        a   b   c   d   e   f   g   h   i   j
                      |---|---|---|---|---|---|---|---|---|---|
                    1 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    2 |   |   |   | x |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    3 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    4 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    5 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    6 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    7 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    8 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    9 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    10|   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
    
                      HIT!
    
                      Player, enter your move: a4
    
                        a   b   c   d   e   f   g   h   i   j
                      |---|---|---|---|---|---|---|---|---|---|
                    1 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    2 |   |   |   | x |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    3 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    4 | ~ |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    5 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    6 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    7 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    8 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    9 |   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
                    10|   |   |   |   |   |   |   |   |   |   |
                      |---|---|---|---|---|---|---|---|---|---|
    
                      MISS :(
    
                      Player, enter your move: ..
                    

    The more advanced version of battleship has ships that are a line of squares, and are placed horizontally or vertically:

    • When the game starts, All ships are randomly placed on the board, either horizontally or vertically. Two ships cannot occupy the same square. The are 4 submarines of size 1 (already done), 3 destroyers of size 2, 2 cruisers of size 3, and one battleship of size 4.
    • On the player's turn, they again specify a board square they wish to "shoot". A ship can be hit as before (represented by "x"), but is only completely sunk when all the ship's squares are hit (represented by "*"). So the player is told if they "HIT", "MISSED", or "SUNK" a ship, and the board is updated.
    • The game finishes after 40 turns, or earlier if the player sinks all ships.


    Calendar app

    Make a calendar program. The user can:

    • Add events for a particular day
    • List all events for a particular year, month or day
    • Remove a particular event

    Example

                    What do you want to do?
                    1. Add an event
                    2. List events
                    3. Delete an event
    
                    => 1
    
                    Please enter the day of the event:
                    => 2018-06-29
                    Please enter the event information:
                    => Attend CoderDojo
                    Event "Attend CoderDojo" added for 2018-06-29
    
                    What do you want to do?
                    1. Add an event
                    2. List events
                    3. Delete an event
    
                    => 2
    
                    Please enter the date range to list events from (e.g. year: "2018", or month "2018-06", or day "2018-06-29"
                    => 2018-06
                    Events in 2018-06:
                    2018-06-29: "Attend CoderDojo"
    
                    What do you want to do?
                    1. Add an event
                    2. List events
                    3. Delete an event
    
                    => 3
    
                    Please enter the date range to list (deletable) events from (e.g. year: "2018", or month "2018-06", or day "2018-06-29"
                    => 2018-06
                    Deletable events in 2018-06:
                    1. 2018-06-29: "Attend CoderDojo"
                    Which event do you wish to delete? (enter its number)
                    => 1
                    Event deleted:
                    2018-06-29: "Attend CoderDojo"
                    


    Regular Expressions

    What if you need to find particular letter sequences in a large piece of text, like all email addresses, or all phone numbers? You'll need something called a "regular expression" for that. A regular expression lets you define the pattern of letters that you're looking for, and then find all letter sequences matching that pattern. For example, the regular expression "ab+a" says "match sequences of letters that start with 'a', are followed by any number of 'b's, and end with another 'a'. So this regular expression matches "aba", "abba", "abbba" and so on.

    Learn about regular expressions by playing the RegexOne game. The game gradually teaches you more complicated regular expressions through a sequence of exercises. When you've finished this, you can play around with regular expressions at regex101.


    Word Funnel

    Write a program that takes two words, and says whether the second word can be made from the first by removing one letter. All other letters must remain in the same order. For example:

    • funnel("leave", "eave") => true
    • funnel("reset", "rest") => true
    • funnel("dragoon", "dragon") => true
    • funnel("eave", "leave") => false
    • funnel("sleet", "lets") => false
    • funnel("skiff", "ski") => false

    Advanced

    For every word in the dictionary, output all other words that can be made by removing one letter from the first (using what you just coded :-). For example:

    • bonus("coasts") => {'coast', 'costs', 'oasts', 'coats', 'casts'}
    To get started, here's a link to a dictionary of words

    Thanks to Reddit dailyprogrammer


    Scoring a Game

    5 friends (called Alex, Ben, Caitlin, Dean and Erin) are playing a game, and keeping track of scores. When someone scores a point, their initial (letter) is typed in lowercase. When they lose a point, their initial is typed in uppercase. So "aaAb" means in that round Alex (player "a") gained two points then lost a point, then Ben (player "b") gained a point. Write a program which takes in the recorded scores, and gives the total scores for each player, ranked high to low. So "aaaAb" would be: a:2, b:1.

    Challenge input:

                    abcde
                    dbbaCEDbdAacCEAadcB
                    EbAAdbBEaBaaBBdAccbeebaec
                    
    Challenge output:
                    abcde -> a:1, b:1, c:1, d:1, e:1
                    dbbaCEDbdAacCEAadcB -> b:2, d:2, a:1, c:0, e:-2
                    

    Thanks to Reddit dailyprogrammer


    Convert currency with API data

    Write a program that converts one currency amount to another. Here is an example of UK pounds (GBP) to US dollars (USD):

    • Input: 1.22 GBP to USD
    • Output: 1.57 USD
    You will need currency conversion information: for each currency what is the rate to convert into other currencies? To start with, just allow conversions from UK pounds (GBP) to 3 other currencies, using these conversion rates:
    • GBP -> USD: 1.2793188994
    • GBP -> EUR: 1.1276499774
    • GBP -> JPY: 143.3581416328
    Now to make it more fun, use an Internet API to get live currency conversion information. Use https://exchangeratesapi.io: You will need to call the API for currency information, load the response (which is in JSON format), read out the currency conversion rate you want, and use it.


    Santa's Christmas list

    Santa needs to write a list of all the good children and what they want for Christmas. Write a program in any language to ask for a name. Then ask if they have been good this year. If they have been good, store the name in a list called names and ask what present they would like. Store the present in another list called presents. The elves need to read the list to pack the presents. Show each name next to the present they want on the screen.

    Getting started:

    • To ask a question in Python use an input() statement; in Javascript you can use prompt
    • Your lists can be a Python list, a Python dictionary, a Javascript array or many more

    More advanced: The elves sometimes get confused and need to look up what present they packed for who. Ask for a name, find it in the names list and look up what present they had from the presents list. Print the name and present to the screen.


    About Me

    Make an About Me program (that tells people about yourself) by following along with this tutorial.

    After that: the About Me tutorial comes from the Raspberry PI website, which has a bunch of other coding projects. Try them out.


    Create a spinner in Python

    Did you know that you can do lots of exciting things with text in Python? In this challenge you will learn how to make a line look like it is spinning on the screen. There are plenty of hints and alternative methods here.

    Getting started:

    • To make the spinning line you will need to use a series of characters [|/-\]. Can you find them all on the keyboard?
    • Add the characters to a Python list
    • Import the time and sys libraries at the top of your code
    • Display the characters one after another using a for loop and sys.stdout.write() which is a simpler way of printing to the screen
    • Insert a delay in your for loop using time.sleep() to control how fast the characters are displayed
    • Use \b to move the cursor one letter back and make the symbols appear on top of each other
    • Use sys.stdout.flush to make the symbols appear as the program runs rather than just at the end

    More advanced: Add a second for loop to draw a line of dashes on the screen behind the spinner that gets longer with time.


    Fix those dates

    My American pal always writes dates with the month in the wrong place, and dots instead of slashes to split things up: 04.27.2019. Write a piece of code to make his dates look the way we write them in the uk: 27/04/2019.

    Getting started (in Python):

    • Take an American formatted date as input.
    • Use position ranges to extract the month, day and year, or use split.
    • Use join to join the month, date and year in the correct order.
    • Print the result to the screen

    More advanced: Is there a faster way of doing this? See the datetime library and regular expressions


    Web scraping

    Follow along with this Python tutorial, where you get to write a program to 'scrape' useful information from a web page. 'Web scraping' is very useful once you know how to do it - Google scrapes millions of web pages to make its search engine work.


    Palindrome checker

    Write a program that checks if a word is a palindrome. So “racecar” would return “Is a palindrome”, but “banana” would return “Is not a palindrome”.

    More advanced:

    • Once the program has checked 6 words, it should exit and list those words that were and weren't palindromes in two separate lists.
    • Structure the program code so it uses an is_palimdrome "function". The function is supplied a word, and returns a boolean (true or false) to indicate where the word is (or is not) a palindrome.
    • Make sure the program still works in the supplied word has uppercase and lowercase letters. So "RaCecar" is still a palindrome.


    Raspberry Pi course: Introduction to Python

    Python is a very popular coding language. Take a look at the free Raspberry Pi "Introduction to Python" course.


    Codecademy course: Learn Python

    Python is a very popular coding language. Take a look at the free Codecademy "Learn Python 2" course.


    Word Balancer

    Assume a word only contains the letters 'x' and 'y'. Write a program that checks if a word contains the same number of 'x's and 'y'. For example:

    • xxxyyy => true
    • yyyxxx => true
    • xxxyyyy => false
    • yyxyxxyxxyyyyxxxyxyx => true
    • xyxxxxyyyxyxxyxxyy => false
    • x => false

    More advanced: assume a word can contain any letter (all lowercase). Change your program to check if all letters appear the same number of times. For example:

    • xxxyyyzzz => true
    • abccbaabccba => true
    • xxxyyyzzzz => false
    • abcdefghijklmnopqrstuvwxyz => true
    • pqq => false
    • fdedfdeffeddefeeeefddf => false
    • www => true
    • x => true

    Thanks to Reddit dailyprogrammer


    Dice Roll

    Follow along with this YouTube tutorial to create a dice rolling program in Python. Use your favorite Python editor or the repl.it online Python editor.

    More advanced: add a second dice, show both scores and the total.


    Write webpages with code

    You have to do the same thing over and over when you write a website by hand - what if you could write a program to do all the boring bits for you? We're going to write a program which generates webpages automatically!

    Getting started:

    • You are going to use text handling and user input commands.
    • Firstly we need to get some information from the user. Ask for the page title, body text and background colour. In Python use the input() method.
    • We need some variables containing the default HTML code that is on every page. You could have a variable called Header which has everything up to the body tag and another called Footer with everything at the end.
    • Add all the different parts of the web page together: the title and so on supplied by the user, and the default HTML code. Use the concatenation operator +.
    • Print your HTML text to the screen. Copy the HTML into a text editor, save it to a file with .html on the end and open it in a web browser to see how it looks.

    More advanced: Change your program to save your webpage as an html file, rather than printing it to the screen.


    A Christmas turtle

    Follow along with this Christmas Coding Challenge. You'll learn how to draw in Python with a turtle, and then draw Christmas pictures. Have fun!


    What day is my birthday?

    Make a program that says which day of the week your birthday falls on for the next 10 years. Remember to account for leap years! For 25 January, we have:

    • January 25, 2020: Saturday
    • January 25, 2021: Monday
    • January 25, 2022: Tuesday
    • January 25, 2023: Wednesday
    • January 25, 2024: Thursday
    • January 25, 2025: Saturday
    • January 25, 2026: Sunday
    • January 25, 2027: Monday
    • January 25, 2028: Tuesday
    • January 25, 2029: Thursday


    Mess about with Databases

    There are a few online tools that can help you learn about databases. W3schools have a tool that lets you play with a SQL (Simple Query Language) database - have a go!

    Getting started:

    • Visit https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all in your web browser. There is an example customer database for a shop ready for you to use.
    • Before you begin, click the "Restore Database" button on the right to reset the database.
    • Try running this SQL statement: "SELECT * FROM Customers ORDER BY CustomerName;".
      The SQL statement queries the database, asking for all fields in the Customers table ordered by customer name. Look at the result - is it correct?
    • Change the ORDER BY part of the SQL statement so that the result is ordered by city. Look at the result - did it work?
    • Change the SQL Statement to extract all the customers with names starting with A. You will need to use WHERE, LIKE and wildcards to do this. WHERE restricts the query to a field within a table. LIKE compares the contents of a field with the thing you want. The thing you want is defined with a string and a Wildcard - don't forget to put the string in quote marks 'like this'. In this case you can use the wildcard % which means zero or more letters, so 'A%' means any entry beginning with A. To learn more, try the SQL tutorial at https://www.w3schools.com/sql.
    • Change the SQL Statement to find the price of the most expensive product. You will need the MAX function to get the maximum value and the AS function to give the database somewhere to put the result.


    Summing Letters

    Assume every letter has a value matching its position in the alphabet. So 'a' is '1' and 'z' is 26. Write a program that takes a word and sums the values of all the word letters. For example:

    • "" => 0
    • "a" => 1
    • "z" => 26
    • "excellent" => 100
    • "microspectrophotometries" => 317

    More advanced: download this word list to continue the challenge:

    • "microspectrophotometries" is the only word with a letter sum of 317. Find the only word with a letter sum of 319.
    • How many words have an odd letter sum?
    • There are 1921 words with a letter sum of 100, making it the 2nd most common letter sum. What letter sum is most common, and how many words have it?
    • "zyzzyva" and "biodegradabilities" have the same letter sum as each other (151), and their lengths differ by 11 letters. Find the other pair of words with the same letter sum whose lengths differ by 11 letters.
    • "cytotoxicity" and "unreservedness" have the same letter sum as each other (188), and they have no letters in common. Find a pair of words that have no letters in common, and that have the same letter sum, which is larger than 188. (There are two such pairs, and one word appears in both pairs.)

    Thanks to Reddit dailyprogrammer


    Morse Code

    Write a program that converts a word into morse code, where each letter is shown as dots and dashes The codes for 'a' to 'z' are:

    .- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..

    Examples:

    • "sos" => "...---..."
    • "daily" => "-...-...-..-.--"
    • "programmer" => ".--..-.-----..-..-----..-."
    • "bits" => "-.....-..."
    • "three" => "-.....-..."
    If you want to mess around with encoding lots of English words, here's a giant word list.

    More advanced: write a program that takes a word in morse code, and converts it back to the original word. So "...---..." is "sos". This reverser program is trickier than it looks, as multiple words can have the same morse code (when all the dots and dashes are squashed together). In the examples above, "bits" and "three" are both "-.....-...". To make the reverser program easier to code:

    • First change your convertor program to put a space between each letter code. "bits" is now "-... .. - ..." and "three" is now "- .... .-. . .", so the two words look different. Decoding should now be easier, as you can see the individual letter codes - which are now separated by spaces.
    • Then change your convertor program back, so there's not space between letter codes. Decoding is trickier, as you'll need to write out all the words that the morse code could decode to. So "-.....-..." can be "bits" or "three".

    Thanks to Reddit dailyprogrammer


    Get started with Unity software for making games

    Follow along with this tutorial for learning Unity: software that lets you make games.


    Picture ideas generator

    Sometimes you fancy drawing a picture, but don't know what to draw. What you need is a picture ideas generator!

    Here's how it works. You will write a program that prints out a suggestion of something to draw: "Draw a picture of a monkey wearing a hat, standing in front of a mountain", or "Draw a picture of a rabbit wearing a jumper, standing in front of a dustbin".

    To do this:

    • Make a list (array) of animals: monkey, rabbit, etc
    • Make a list (array) of clothes: hat, jumper, etc
    • Make a list (array) of clothes: hat, jumper, etc
    • Randomly pick a word from each of the three lists, then combine them into a sentence

    Once you get the idea of making a sentence out of randomly chosen words, make the sentence more complicated. So you could replace "standing in front of" with say "dancing on top of", or whatever.


    Maths Challenge

    Write a program that generates random maths challenges, like "4 x 3", or "7 - 2", or "12 + 3". The user then enters the answer, and the program marks them right or wrong.

    Hints

    • For choosing numbers, take a look at your programming language's "random number" function. This should let you generate a random number between two values (e.g. give me a number between 1 and 10).
    • For choosing the operator (add, subtract, multiply, divide), stick all the operators in an array. Then use the "random number" function to pick the array index of the operator.
    • For marking the answer, generate the correct answer yourself, and compare it against the one given by the user.


    Summarising a list of numbers

    Write a program that gives you summary statistics for a list of 10 numbers. The user enters the numbers, and the program then writes out the minimum and maximum numbers in the list, the average, the mode and the median. Write the code yourself to calculate these statistics. Most programming languages will have library functions for all these statistics. But using them is too easy!


    Calculate how long a King or Queen ruled for

    Write a program that calculates how many days a King or Queen ruled for. The program will ask for the name of the King/Queen, which date they were crowned, and which date they died. The program will then write out how the number of days between those two dates. For example:

                            What's the name of the monarch?: Queen Elizabeth
                            When were they crowned?: 2 June 1953
                            When did they die?: 8 September 2022
    
                            Queen Elizabeth reined for 25301 days.
                        

    Hints:

    • If this is tricky, write a simpler program that says how many years a monarch reigned, when given the coronation year and year they died.
    • Then write a program that says how months a monarch reigned.
    • Then write the full program that says how many days a monarch reigned. There are code libraries that let you calculate the day difference between two dates.

    Coding - Microbits

    At Stirling CoderDojo, we have micro:bits to play with. Ask a mentor if you would like to use one. A micro:bit is a cool little computer with LEDs, a compass, motion detection and temperature detection. So you can make it to do cool stuff like show the temperature when you shake it! There’s a web-based Block Editor (like Scratch) for writing and testing code. When you’re happy with the code, you need to transfer the code to the micro:bit. To do this:

    • Plug the micro:bit into your computer using the usb cable. The micro:bit should show up in your computer as a new hard drive
    • Click ‘compile’ in the Block Editor, and your code will download to your computer in a file called ‘something.hex’
    • Drag and drop the ‘something.hex’ file onto the micro:bit hard drive. The code should now be running on the micro:bit!
    Useful links:


    Talk between Microbits

    Find a friend and talk between Microbits. Use the radio functions on the microbits to get them to talk to each other.

    Simple:

    More complicated:


    Using Microbits with Scratch

    You can now connect microbits to scratch, and do stuff like use the microbit as a controller for your scratch game. Have a go by following along with this tutorial. You will need your own computer to do this.


    Hold-it-there game

    Make a hold-it-there game. The object of this game is to light up all the LEDs on the Microbit and keep them on - but it's not so easy! When your program detects the Microbit is tilted forward, light up the LEDs one after the other. Stop lighting the LEDs when the Microbit is held flat. Every time you light a new LED make the time before you light the next LED shorter. Use a variable with a name like LEDtime to hold the current time interval. Each time a LED is lit, LEDtime decreases. When all the LEDs are lit wait for LEDtime then turn them all off again. Now its tricky to light all the LEDs without having to start over again. Program one of the buttons on the Microbit to reset the game.

    Getting started:

    • You need to light all the LEDs one after another. You can do this with a long sequence of patterns or you could be more clever and use a for loop
    • You need to use the accelerometer to see which way the Microbit is tipped

    More advanced: Light the LEDs randomly using Random.


    Send a love letter

    Send a heart sign and message between two microbits.

    Getting started:

    • You will be writing a program that should run on both microbits, so it will handle both sending and receiving messages
    • Use the "radio send string" block to send a message between the microbits: https://makecode.microbit.org/reference/radio/send-string
    • Run the "radio send string" block when button A is pressed
    • Use the "radio on received" block to receive the message: https://makecode.microbit.org/reference/radio/on-received-string
    • Design a heart shape for the microbit LED display
    • When the microbit receives the message, display the heart shape then scroll the message
    • And remember: the program will need to be installed on both microbits

    A bit more advanced: have different messages you can send. Use the two A and B buttons to send up to three different messages (depending on whether one or both buttons are pressed)


    The Chase

    Make a 2-player game where you try to catch your opponent's dot as you chase one another round the screen! Getting started:

    • You will need two microbits.
    • Use the A and B buttons to move your dot on the screen. A moves the dot right, and B moves it down.
    • Make the screen "wrap", so if your dot goes off the right side of the screen, it appears on the left side. And the dot going off the bottom appears at the top.
    • Relay your dot's position to your opponent's microbit using the radio sendValue feature. And show your dot on their screen (as a flashing dot).
    • If both dots end up on the same screen pixel, then game over!


    Crashy Bird

    Make a "Flappy Bird" game on your microbit by following along with this tutorial.


    Beating Heart

    Make a beating heart animation on your microbit by following along with this tutorial.


    Racing Game

    Follow along with this tutorial to make a racing game on your microbit. There's a video on the tutorial page that shows the finished game - looks pretty cool!


    Night light

    Follow along with this tutorial to turn your microbit into a nightlight. The microbit changes what it shows depending on the light level.


    Microbit compass

    Follow along with this tutorial to turn your microbit into a compass. The microbit changes what it shows depending which direction you face.


    YouTube tutorial: Rock, Paper, Scissors

    Make a "Rock, Paper, Scissors" game on your microbit by following along with this 4 minute youtube tutorial.


    Step Counter

    You’ve made a New Year’s resolution to do more exercise, like walking. Make a step counter with your microbit (that counts how many steps you’ve walked). Getting started:

    • Use the “shake” to detect a step, then show the number on the screen.
    • Test your step counter by somehow attaching it to your foot. You’ll need a battery pack too!
    • Maybe have a reset button, so you can set the counter back to zero.


    Consonant or Vowel?

    In this game the player has one second to press button A when a consonant is displayed on the microbit screen, and button B when a vowel is displayed.

    • Start this challenge by displaying the letters A or B. You will need to use the Random function to choose which.
    • You will need two variables to remember if either button has been pressed. Use the "on button pressed" event to set each varable to 1.
    • Set a delay of 1 second after A or B is shown and then check your variables to see if the button was pressed.
    • Display a tick or a cross to show if the correct button was pressed in time.
    • Reset your variables to 0.

    The next part deals with the consonants and vowels.

    • You will need to create two lists, one for all the consonants and one for all the vowels.
    • Where you displayed A or B in your code above, you should display either a random vowel from the vowel list, or a random consonant from the consonant list.

    Stopwatch

    Make a stopwatch that displays how many seconds have passed since button A was pressed.

    • Button A starts the stopwatch.
    • Button A (2nd press) stops the stopwatch.
    • Button A (3rd press) restarts the stopwatch, and so on.
    • Button B stops the stopwatch, and resets the seconds counter to zero.
    Watch this tutorial if you need some help.


    Daytime Detector

    Make your microbit into a "daytime detector", and show a sun when it's light, and nothing when it's dark.

    Hints:

    • Use the "light level" variable (in the "Input" section of the editor) to detect light level
    • You'll need to show the sun when the "light level" is bigger than say 100
    • You'll need a "forever" block to keep checking the light level
    • You should be able to test your "daytime detector" by shining a light at it (and the sun should appear) or covering it with your hand (the sun should disappear).

    More advanced: change the size of the sun shown, depending on the light level. So show a small sun when it's a bit bright, and a big sun when it's really bright.

    Thanks to micro:bit at home.


    Hottest and Coldest

    Make your microbit show the hottest and coldest temperatures its seen by following along with this tutorial.


    Christmas Decoration

    Follow along with this tutorial to turn your microbit into a Christmas decoration!