October 2025

🔄

Functions

Open in Code Editor Copy Instructions Submit Solution

Challenge Instructions

For AS especially, they sometimes might ask you to implement one of the given functions (i.e. as if you were creating the programming language from scratch) from either fundamental constructs (iteration (loops), selection (if/case) etc), or from a subset of the other functions on the course

Below are all the functions for both IGCSE/O-Level and AS - let's try to implement as many as possible as a group

If you are confused about any of these function's operation, you can see the syllabus for IGCSE & O-Level, the official pseudocode guide for AS or the demo programs on this site

For example, you can call you function MY_SUBSTRING for example and create a series of tests like: OUTPUT MY_SUBSTRING("abcde", 2, 3") = SUBSTRING("abcde", 2, 3) to ensure your functions work as expected

IGCSE & O-Level Functions

AS Functions

You can also create your own functions or simulate e.g. bitwise operators - AND("0011", "1010") would return "0010" as a string...or 2 if you decide to return an integer

Or create a function to check if two strings are equal, without using the = operator for string comparisons

As a target, let's try and have 10 programs submitted by members of the community for others to enjoy...good luck...and have fun!


Top Submissions


Submission Instructions

Create your program on the editor page, then click the upload button at the bottom of the code editor as shown below

Once you are confident your program is working well without obvious bugs, then give it a relevant name, choose the current monthly challenge from the dropdown box, choose some program categories if you want and submit it :)

Note: your submitted programs will be in blue and you can overwrite them by opening them, clicking the upload button again and selecting "overwrite"