Design to code
Start with a problem you understand. Make the steps precise, use blocks to represent the algorithm and read the pseudocode Pseudly generates. Then check its behaviour. The same algorithm can be translated into different programming languages.

- Download blank Input, Process, Output worksheet
- Download A4 landscape poster PDF
- Download blank description to Python worksheet
Explain the decision
Pack a school bag. If rain is forecast, pack a raincoat; otherwise pack a hat. In this simplified model, a forecast with no rain means we choose a hat. We are not claiming every dry day is sunny.
The example starts with a true forecast and an empty bag. It adds exactly one item, then prints the bag. Change the forecast to false and predict the alternative branch. Read the pseudocode before running, follow the highlighted instructions and explain any difference from your prediction.
The language panels illustrate translations of the same algorithm. Pseudly generates the pseudocode; these illustrations do not mean it exports JavaScript or C++.
Real blocks and their pseudocode

SET rainForecast TO TRUE
SET bag TO []
IF rainForecast THEN
SET bag TO (APPEND "raincoat" TO bag)
ELSE
SET bag TO (APPEND "hat" TO bag)
END IF
PRINT bag
Appending in Python: bag is a list object. Use bag.append("raincoat") in the true branch and bag.append("hat") in the false branch. The method changes the existing list; do not assign its return value to bag. The real pseudocode above uses Pseudly’s value-returning APPEND expression, so SET retains that result. Both versions choose the same item in this example.
Implement in a language
Each implementation starts with the same forecast and an empty bag. A true forecast packs a raincoat; false packs a hat. Printed list formatting differs, while the selected item is equivalent. The C++ poster shows the body of main; the complete program is below.
JavaScript
const rainForecast = true;
let bag = [];
if (rainForecast) {
bag = [...bag, "raincoat"];
} else {
bag = [...bag, "hat"];
}
console.log(bag);Python
rainForecast = True
bag = []
if rainForecast:
bag.append("raincoat")
else:
bag.append("hat")
print(bag)C++
#include <iostream>
#include <string>
#include <vector>
int main() {
bool rainForecast = true;
std::vector<std::string> bag;
if (rainForecast) {
bag.push_back("raincoat");
} else {
bag.push_back("hat");
}
for (const auto& item : bag)
std::cout << item << '\n';
return 0;
}
Apply the idea
Use the Input, Process, Output worksheet to identify the required data, processing and results before designing the algorithm.
Use the blank worksheet to describe a problem, design its pseudocode and plan a Python implementation. Identify sequence, selection and iteration where they are needed. State assumptions and predict results before running.