Pseudocode compiler

Write Cambridge pseudocode for O Level 2210, IGCSE and AS and A Level 9618, run it, and dry-run it with a trace table. It runs in your browser, so nothing you type is sent anywhere.

main.pseudoSaved in this browser

Syntax reminders
VariablesDECLARE Count : INTEGER   Count ← 0 (type <-)   CONSTANT Pi = 3.14
Input and outputINPUT Name   OUTPUT "Hello ", Name
SelectionIF ... THEN ... ELSE ... ENDIF   CASE OF x ... OTHERWISE ... ENDCASE
LoopsFOR i ← 1 TO 10 STEP 2 ... NEXT i   WHILE ... DO ... ENDWHILE   REPEAT ... UNTIL ...
ArraysDECLARE A : ARRAY[1:10] OF INTEGER   DECLARE G : ARRAY[1:3,1:4] OF STRING
SubroutinesPROCEDURE P(BYREF x : INTEGER) ... ENDPROCEDURE   FUNCTION F(a : INTEGER) RETURNS INTEGER ... RETURN ... ENDFUNCTION   CALL P(x)
RecordsTYPE Pupil ... DECLARE Name : STRING ... ENDTYPE   Pupil.Name
Text filesOPENFILE "f.txt" FOR READ   READFILE   WRITEFILE   CLOSEFILE   EOF("f.txt")
Operators+ - * / ^ DIV MOD &   = <> < > <= >=   AND OR NOT
FunctionsLENGTH LEFT RIGHT MID UCASE LCASE ASC CHR INT ROUND RAND SQRT ABS NUM_TO_STR STR_TO_NUM IS_NUM
Press Run to execute your program.

Press Ctrl + Enter to run. Text files you create with OPENFILE last until you leave the page. Keywords must be written in capitals, and a value is given with ←, which you type as <-.