Loading

Search Code

Search code contents

Close File Browser

Execution Mode

Live: will automatically execute upon every character typed (warning: could result in issues if you have intensive or partially-completed code that results in an infinite loop)

Exited code editor: will automatically execute code when the code editor loses focus - i.e. when you click outside of the code editor

Run on click: code will only be executed when you click the triangular run/play button

File Manager

Search & browse files easily

Pseudocode

Write and run pseudocode

Java

See a Java equivalent to your pseudocode program

Note: the site doesn't allow executing Java. An IDE like IntelliJ will provide an easy installation of the JDK and is recommended for running Java locally

Python

See a Python equivalent to your pseudocode program

Note: the site doesn't allow executing Python. An IDE like PyCharm will provide an easy installation of the Python interpreter and is recommended for running Python locally

Visual Basic

See a Visual Basic (VB) equivalent to your pseudocode program

Note: the site doesn't allow executing Visual Basic. An IDE like Visual Studio will provide an easy installation of the Visual Studio compiler and is recommended for running Visual Basic locally

New Program/Template/Snippet

Choose from a number of pre-made programs or create your own

Modifying a pre-made program will automatically create a new program, ensuring the original & modified version are available

You can also create a new template file (i.e. common code you want to use as a template for new programs) or custom code snippets (editor dropdown autosuggestions)

Create Trace Table

Automatically create trace tables for your code

Can use the BREAKPOINT keyword to add breakpoints at specific parts of your program

Use TRACE_NEXT_ROW to force new row to be created in trace table

Autoformat Code

Toggle original/formatted code

Pretty-printing/auto-formatting code will insert new lines, indentation and apply consistent styling rules. If enabled, pretty-printing will also occur each time you run your program

You can even try writing your entire program on one line...and it should still run and be formatted correctly :)

Note: code may be re-ordered (e.g. all declarations moved to the top) due to the way the site works

Tested and works for all demo programs - please contact me if this breaks any of your working code!

Show Tokens

Display the program broken down into tokens after the tokenisation ("lexical analysis") stage

Show Flowchart

Display a flowchart of the program

Show Abstract Syntax Tree

Display a visual representation of the parse result of the program

Load

Load a previously-saved pseudocode file (.pseudo default extension)

Download

Download one or more .pseudo files for future use (e.g. backup/sharing/transferring to a different device)

Programs will be saved periodically (every 10 seconds) to your browser's local storage if changes are made - this means you can access your programs across multiple tabs

Note that these local saves won't persist next time you open the site if you were using it in a private window - clearing your browser's cache will also cause all your programs to be lost

Upload

Save your program for public-viewing by anyone

Sharing

Share a direct link containing your code - your code will be contained in the URL and NOT stored on the server

Alternatively, you can select the upload option to upload your code publicly to the server

Quiet Editor

Remove bloat like the navigation bar & footer to focus only on the code editor

Note: can be toggled with CTRL + Q (quiet mode)

Fullscreen Quiet Mode

Toggle between regular and fullscreen mode

Note: pressing FN/F11/ESC keys isn't recommended, since they can't be detected by the site, hence the additional 'quite mode' settings can't be applied - the removing of the nav bar & footer. To enter this fullscreen mode, either use this button or the keyboard shortcut CTRL + M (minimise <-> maximise)

Add Favourite

Add this code as a favourite you can view later

No errors βœ…

Error Checks

The site aims to enforce the statically-typed nature of pseudocode - i.e. assigning a STRING to an INTEGER variable should be forbidden. Some combinations are allowed, however - such as assigning a CHAR to a STRING or an INTEGER to a REAL. Other additional checks to ensure valid pseudocode are also in place

The site has been well-tested and there aren't any bugs we are aware of, however, if you believe the site is incorrectly giving you an error & preventing your code from running, you can disable the error-checking

In such cases, please feel free to contact us

Note that it is not possible to disable fatal error messages such as syntax errors, runtime errors etc

Subroutine Signature Hints

If enabled, the following information will be shown:

  • Keyword/Identifier/Module Name Suggestions
  • Subroutine parameters & types
  • Return types
  • Subroutine descriptions
  • Examples

Switch Program Shortcuts

Choose whether CTRL + SHIFT + LEFT/RIGHT should navigate to the previous program - can be disabled to prevent accidental triggering

Toggle Keyboard Shortcuts

Enable or disable this website's additional keyboard shortcuts (switch program, change font size, code execution etc) - note: standard editor & browser shortcuts will still apply

Use Assignment Arrow

Will cause "<-" to be replaced with the Unicode "←" symbol as the user is typing - can also use CTRL + SHIFT + < to insert this symbol

Allow Array Multi-Assignment

If enabled, you won't get warnings for assigning all values to an array in one statement - e.g. myArray <-- [1, 2, 3]

Allow LENGTH() for Arrays

Turning this on will disable the warning message if using the LENGTH function to get the number of elements in an array

Require Variable Initialisation

If enabled, you will get warnings if trying to access uninitialised variables

Code Snippets

These are pre-written code templates - for example, if you type in "DECLARE" in the code editor, you will see options to declare single variables, 1 & 2D arrays - you can disable this option

Add Custom Code Snippet

Enable Live Terminal Output

By default, program output will wait until either an input statement or the program end to be displayed - this is fast, but sometimes you might want to see the program output displayed as the program is actually running. If you enable this, note that the browser can become extremely slow - a simple loop appending the numbers 1 to 1 million in JavaScript to a textarea froze the entire browser and didn't finish executing in 5 minutes for reference...

Show Toolbar Program Browser

If enabled, will show the program browser in the toolbar even if the sidebar file browser is open

Show Welcome Message

Toggle the welcome message/popup in the bottom right corner from showing

Wait for Tips

Will show the loading screen until at least the tip (hint) has been displayed, even if the site is fully loaded. Disabling this can hence make the editor screen appear faster, if the page is ready

Max Execution Time

To prevent infinite loops resulting in the page becoming unresponsive, code will automatically terminate if this value (in seconds) is exceeded

If you have a legitimate long-running program, you can obviously set this to a high value - alternatively, setting to -1 will disable this check

IGCSE Syllabus (Pseudocode p35) O-Level Syllabus (Pseudocode p35) A-Level Syllabus A-Level Pseudocode Guide A-Level Pseudocode Functions Report Bugs
YouTube Tutorials Discord Help
AssemblyCode BooleanLogic CIESchedule Program52
DemosπŸ§‘πŸ»β€πŸ« KeywordsπŸ“œ Monthly Challenge: Getting...πŸ“† πŸ’¬
{"0":"Algorithms","1":"Selection","2":"Iteration","3":"Arrays","4":"Records","5":"ENUMs","6":"Custom Modules","7":"Files","8":"Object-Oriented Programming","9":"Abstract Data Types","10":"Sets","11":"Pointers","12":"Recursion","13":"Exam Questions","14":"Games","15":"Mathematics","16":"Art","17":"Utilities","18":"Other"}

Welcome to Pseudocode Pro

This site was developed to solve the problems of students either being completely stuck with pseudocode, or attempting a solution, but having no way of actually validating if it would work (other than a manual trace table). This site supports the entire Cambridge IGCSE (0478), O-Level (2210) and 9618 A-Level pseudocode specifications from the guide/syllabus, with extension modules supporting sound, canvas, events, custom html etc

Below are lists of both the currently support pseudocode and general website features:

  • πŸ“¦ Variables & Constants
  • βž• Arithmetic & Logical Operators
  • πŸ“₯πŸ“€ INPUT & OUTPUT
  • β“βŒ IF/ELSE & CASE
  • πŸ” FOR/WHILE/REPEAT...UNTIL Loops
  • πŸ”§ FUNCTIONS & PROCEDURES
  • πŸ”’ BYVAL & BYREF
  • πŸ”’ ARRAYs
  • πŸ“’ TYPEs (Records & Enums)
  • πŸ“„ File Handling (Text & RANDOM)
  • 🧩 Object-Oriented Programming
  • πŸͺ£ Sets
  • πŸ‘‰ Pointers
  • --- Extra Non-Syllabus Features ---
  • πŸ”Š Sound
  • 🎨 Canvas
  • πŸ–²οΈ Events
  • πŸ–₯️ Custom HTML

Additional programs uploaded by the community can be found on the search page.

While you are here, why not try one of the many - and ever increasing list of - pseudocode coding challenges.

To support hosting & domain costs, for $2, a premium account can be purchased - this has the following benefits:

Those last 2 features are currently in progress, so an extra 3 months free will be given to anyone who buys a license now to acknowledge this

For any issues, feature requests, comments etc, you can contact me

Token List

Work in progress: some buttons currently don't work...just select "All"

Token Description Example Parameters

Thanks for using the site - I hope you enjoy it and if you do, it would mean a lot if you could share it with your friends too :)

Drag & drop code or data files here

{"c":"\/\/ * Code Author: \n\/\/ * Date: 2026\/10\/30\n\/\/ * Description: \n\/\/ * Categories: \n\n\/\/ \/\/ DECLARE Weight : REAL\r\n\/\/ \/\/ DECLARE RejectedCount : INTEGER\r\n\/\/ \/\/ RejectedCount <- 0\r\n\r\n\/\/ \/\/ REPEAT\r\n\/\/ \/\/ OUTPUT \"Enter Sack weight: \"\r\n\/\/ \/\/ INPUT Weight\r\n \r\n\/\/ \/\/ IF Weight <> 50 AND Weight <> 999 THEN\r\n\/\/ \/\/ RejectedCount \u2190 RejectCheck(Weight, RejectedCount)\r\n\/\/ \/\/ ELSE\r\n\/\/ \/\/ \t\tWeight = 50 \r\n\/\/ \/\/ OUTPUT \"Accepted\"\r\n\/\/ \/\/ ENDIF\r\n\r\n\/\/ \/\/ UNTIL Weight = 999\r\n\r\n\/\/ \/\/ OUTPUT \"Rejected are = \" & RejectedCount\r\n\r\n\r\n\/\/ \/\/ FUNCTION RejectCheck(PWeight : REAL, CurrentRejected : INTEGER) RETURNS INTEGER\r\n\/\/ \/\/ DECLARE CRejected : STRING \/\/ Local Variable\r\n\/\/ \/\/ DECLARE UpdatedRejected : INTEGER\r\n \r\n\/\/ \/\/ UpdatedRejected <- CurrentRejected + 1\r\n \r\n\/\/ \/\/ IF PWeight < 50 THEN\r\n\/\/ \/\/ OUTPUT \"Rejected due to under weight\"\r\n\/\/ \/\/ ELSE\r\n\/\/ \/\/ OUTPUT \"Rejected due to over weight\"\r\n\/\/ \/\/ ENDIF\r\n \r\n\/\/ \/\/ CRejected <- NUM_TO_STR(UpdatedRejected) \/\/ Type casting\r\n \r\n\/\/ \/\/ RETURN UpdatedRejected\r\n\/\/ \/\/ ENDFUNCTION\r\n\r\n\/\/ \/\/ DECLARE Argument1 : STRING\r\n\/\/ \/\/ OUTPUT \"Please Tell me your name: \"\r\n\/\/ \/\/ INPUT Argument1\r\n\/\/ \/\/ CALL Greet(Argument1)\r\n\r\n\r\n\/\/ \/\/ PROCEDURE Greet(Parameter1:STRING)\r\n\r\n\/\/ \/\/ OUTPUT \"Hello \" & Parameter1 &\" how are you?\"\r\n\r\n\/\/ \/\/ ENDPROCEDURE\r\n\r\n\/\/ \/\/ DECLARE Argument1 : STRING\r\n\/\/ \/\/ OUTPUT \"Please Tell me your name: \"\r\n\/\/ \/\/ INPUT Argument1\r\n\/\/ \/\/ CALL Greet(\"Nouman\")\r\n\r\n\r\n\/\/ \/\/ PROCEDURE Greet(Parameter1:STRING)\r\n\r\n\/\/ \/\/ OUTPUT \"Hello \" & Parameter1 &\" how are you?\"\r\n\r\n\/\/ \/\/ ENDPROCEDURE\r\n\r\n\/\/ DECLARE Name : STRING\r\n\/\/ Name \u2190 Greet(\"Shahaib\")\r\n\/\/ OUTPUT \"Kya haal hain aap k Mr.\/Ms. \" & Name\r\n\r\n\r\n\/\/ FUNCTION Greet(Parameter1:STRING) RETURNS STRING\r\n\r\n\/\/ RETURN Parameter1\r\n\r\n\/\/ ENDFUNCTION\r\n\/\/ DECLARE Num1, Num2, Sr : INTEGER\r\n\/\/ Sr \u2190 1\r\n\r\n\/\/ OUTPUT \"Sr is equal = \" & Sr\r\n\/\/ REPEAT\r\n\/\/ INPUT Num1\r\n\/\/ OUTPUT \"Num1 is equal = \" & Num1\r\n\/\/ INPUT Num2\r\n\/\/ OUTPUT \"Num2 is equal = \" & Num2\r\n\/\/ Sr \u2190 Sr + 1\r\n\r\n\r\n\/\/ OUTPUT \"Sr is equal = \" & Sr\r\n\/\/ UNTIL Sr = 5\r\n\r\n\/\/ DECLARE std_total, Marks, highest, lowest, NumOfStd, NumOfTests: INTEGER\r\n\/\/ DECLARE std_avg : REAL\r\n\r\n\/\/ std_total <- 0\r\n\/\/ std_avg <- 0\r\n\/\/ highest <- 0\r\n\/\/ lowest <- 1000\r\n\/\/ NumOfStd <- 2\r\n\/\/ NumOfTests <- 2\r\n\r\n\/\/Four Students\r\n\/\/ FOR std <- 1 TO NumOfStd\r\n\/\/ \t\/\/Two Tests\r\n\/\/ \tFOR tests <- 1 TO NumOfTests\r\n\/\/ \t\tOUTPUT \"Enter Marks \"\r\n\/\/ \t\tINPUT Marks\r\n\/\/ \t\tstd_total <- std_total + Marks\r\n\/\/ \t\tstd_avg <- std_total\/NumOfTests\r\n\/\/ \t\tOUTPUT \"Avg marks for the Student = \" & std_avg\r\n\/\/ \tNEXT tests\r\n\/\/ \tIF std_total > highest THEN\r\n\/\/ \t\thighest <- std_total\r\n\/\/ \tENDIF\r\n\/\/ \tIF std_total < lowest THEN\r\n\/\/ \t\tlowest <- std_total\r\n\/\/ \tENDIF\r\n\/\/ NEXT std\r\n\/\/ \tOUTPUT \"The highest marks were : \" & highest\r\n\/\/ \tOUTPUT \"The lowest marks were : \" & lowest\r\n\r\n\r\n\r\n\r\n\/\/ DECLARE Linen: INTEGER\r\n\/\/ OUTPUT \"Bhai kitni linen chahiyen tumhen\"\r\n\/\/ INPUT Linen\t\t\r\n\r\n\/\/ CALL Stars(Linen)\r\n\r\n\/\/ PROCEDURE Stars(PLinen:INTEGER)\r\n\/\/ FOR st \u2190 1 TO PLinen\r\n\/\/ OUTPUT \"****\"\r\n\/\/ NEXT st\r\n\/\/ ENDPROCEDURE.\r\n\/\/ OUTPUT \"1 for C -> F and 2 for F -> C\"\r\n\r\n\/\/ OUTPUT \"Today's Temperature = \" & Converter(25,1)\r\n\r\n\r\n\/\/ FUNCTION Converter(Temperature:REAL, Option:INTEGER) RETURNS REAL\r\n\/\/ DECLARE Result : REAL\r\n\/\/ IF Option = 1 THEN\r\n\/\/ Result \u2190 (Temperature * 1.8) + 32\r\n\/\/ RETURN Result\r\n\/\/ ELSE\r\n\/\/ Result \u2190 (Temperature - 32) \/ 1.8\r\n\/\/ RETURN Result\r\n\/\/ ENDIF\r\n\/\/ ENDFUNCTION\r\n\/\/ DECLARE value : REAL\r\n\/\/ value \u2190 RANDOM()*20\r\n\/\/ OUTPUT ROUND(value,0)\r\n\r\n\/\/ DECLARE hold : REAL\r\n\/\/ hold \u2190 RANDOM()\r\n\/\/ OUTPUT \"The value is: \" & hold\r\n\r\n\/\/ OUTPUT ROUND(value,0)\r\n\r\n\/\/Secret Number\r\n\/\/ DECLARE SecNum: REAL\r\n\/\/ DECLARE Guess, SecretNumber: INTEGER\r\n\r\n\/\/ SecNum <- RANDOM()*50\r\n\/\/ SecretNumber <- ROUND(SecNum, 0)\r\n\r\n\/\/ REPEAT\r\n\/\/ INPUT Guess\r\n\r\n\r\n\/\/ \tIF\tGuess < SecretNumber THEN\r\n\/\/ \t\tOUTPUT \"Your Guess is less than that\"\r\n\/\/ \t\tELSE\r\n\/\/ \t\tOUTPUT \"Your Guess is larger than that\"\r\n\/\/ \tENDIF\r\n\/\/ UNTIL Guess = SecretNumber\r\n\/\/ \tOUTPUT \"WON\"\r\n\/\/ DECLARE start, end : INTEGER\r\n\/\/ start \u2190 0\r\n\/\/ end \u2190 5\r\n\/\/ DECLARE Std_Name : ARRAY[start:end] OF STRING\r\n\/\/ Std_Name[0] \u2190 \"Aurangzaib\"\r\n\/\/ Std_Name[1] \u2190 \"Lareb\"\r\n\/\/ Std_Name[2] \u2190 \"Shahzaib\"\r\n\/\/ Std_Name[3] \u2190 \"Balach\"\r\n\/\/ Std_Name[4] \u2190 \"Beeberg\"\r\n\/\/ Std_Name[5] \u2190 \"Paras\"\r\n\r\n\/\/ OUTPUT \"Entered Names are below:\"\r\n\/\/ FOR i \u2190 5 TO 0 STEP -1\r\n\/\/ OUTPUT Std_Name[i]\r\n\/\/ NEXT i\r\n\/\/ DECLARE Hobbies : ARRAY [0:4, 0:2] OF STRING\r\n\/\/ FOR row \u2190 0 TO 4\r\n \r\n\/\/ FOR col \u2190 0 TO 2\r\n\/\/ OUTPUT \"Row \"& row & \" col \"& col\r\n\/\/ INPUT Hobbies[row,col]\r\n\/\/ NEXT col\r\n\r\n\/\/ NEXT row\r\n\r\n\/\/ DECLARE x : INTEGER\r\n\/\/ FOR i \u2190 0 TO 4\r\n\/\/ DECLARE Marks : ARRAY[0:4] OF INTEGER\r\n\/\/ OUTPUT \"Enter your marks\"\r\n\/\/ INPUT Marks[i]\r\n\/\/ NEXT i\r\n\/\/ FOR j \u2190 1 TO 5\r\n\/\/ OUTPUT \"Makr of test \" & j & \" : \" & Marks[i]\r\n\/\/ NEXT j\r\n\r\n\/\/ DECLARE TotUsers, Cols: INTEGER\r\n\/\/ TotUsers \u2190 2\r\n\/\/ Cols \u2190 0\r\n\/\/ DECLARE User : ARRAY[0:TotUsers , 0:2] OF STRING\r\n\/\/ DECLARE Count : INTEGER\r\n\r\n\r\n\/\/ FOR row \u2190 0 TO TotUsers\r\n\/\/ FOR Cols \u2190 0 TO 2\r\n\/\/ OUTPUT Prompt(Cols, row)\r\n\/\/ INPUT User[row,Cols]\r\n\/\/ NEXT Cols\r\n\/\/ NEXT row \r\n\r\n\r\n\/\/ FOR x \u2190 0 TO TotUsers\r\n\/\/ Count \u2190 x + 1\r\n\/\/ OUTPUT Count & \". \" & \" | Username: \" & User[x,0] & \" | Password: \" & User[x,1] & \" | Nickname: \" & User[x,2]\r\n\/\/ NEXT x\r\n\r\n\/\/ FUNCTION Prompt(Cols:INTEGER, row:INTEGER) RETURNS STRING\r\n\/\/ DECLARE msg : STRING\r\n\/\/ IF Cols = 0 THEN\r\n\/\/ msg \u2190 \"Enter Username for person no. \" & (row+1)\r\n\/\/ RETURN msg\r\n\/\/ ENDIF\r\n\/\/ IF Cols = 1 THEN\r\n\/\/ msg \u2190 \"Enter password for person no. \" & (row+1)\r\n\/\/ RETURN msg\r\n\/\/ ENDIF \r\n\/\/ IF Cols = 2 THEN\r\n\/\/ msg \u2190 \"Enter Nickname for person no. \" & (row+1)\r\n\/\/ RETURN msg\r\n\/\/ ENDIF \r\n\/\/ ENDFUNCTION\r\n\/\/=======================================================\r\n\/\/ DECLARE StudentList : ARRAY[1:20] OF STRING\r\n\/\/ FOR i \u2190 1 TO 5\r\n\/\/ OUTPUT \"Enter the name of Student no. \" & i\r\n\/\/ INPUT StudentList[i]\r\n\/\/ NEXT i\r\n\r\n\/\/ OUTPUT \"The entered student names are below:\"\r\n\/\/ FOR j \u2190 1 TO 5\r\n\/\/ OUTPUT StudentList[j] \r\n\/\/ NEXT j\r\n\/\/ DECLARE FileName : STRING\r\n\/\/ FileName <- \"MyWork.txt\"\r\n\/\/ OPENFILE FileName FOR WRITE\t\r\n\/\/ WRITEFILE FileName, \"In the name of ALLAH\"\r\n\/\/ CLOSEFILE FileName\r\n\/\/ DECLARE Line : STRING\r\n\/\/ DECLARE turns: INTEGER\r\n\/\/ OUTPUT \"How many line would you like to see?\"\r\n\/\/ INPUT turns\r\n\r\n\/\/ Line \u2190 \"\"\r\n\/\/ OPENFILE \"MyData.txt\" FOR READ\r\n\/\/ FOR i \u2190 1 TO turns\r\n\/\/ \/\/ REPEAT\r\n\/\/ READFILE \"MyData.txt\", Line\r\n\/\/ OUTPUT Line\r\n\/\/ NEXT i\r\n\/\/ \/\/ UNTIL EOF(\"MyData.txt\")\r\n\/\/ CLOSEFILE \"MyData.txt\"\r\n\r\n\/\/ DECLARE Grid: ARRAY [1:5,1:5] OF STRING\r\n\/\/ DECLARE Letter : CHAR\r\n\/\/ DECLARE CurrentPositionR, CurrentPositionC, ChangedPositionR, ChangedPositionC : INTEGER\r\n\/\/ CurrentPositionR \u2190 2\r\n\/\/ CurrentPositionC \u2190 2\r\n\r\n\/\/ OUTPUT \"Press A for Left, D for Right, W for Up and S for Down\"\r\n\/\/ INPUT Letter\r\n\/\/ IF Letter = \"A\" THEN\r\n\/\/ ChangedPositionR \u2190 Left(CurrentPositionR)\r\n\/\/ OUTPUT \"Now The Row Position is : \" & ChangedPositionR\r\n\/\/ OUTPUT \"Now The COL Position is : \" & ChangedPositionC\r\n\/\/ ELSE\r\n\r\n\/\/ OUTPUT \"BESIDE IF The Row Position is : \" & CurrentPositionR\r\n\/\/ OUTPUT \"BESIDE IF The Col Position is : \" & CurrentPositionC\r\n\/\/ ENDIF\r\n\r\n\r\n\/\/ OUTPUT \"Our Current ROW and COLUMN POSITIONS ARE: \"\r\n\/\/ OUTPUT \"ROW = \" & CurrentPositionR\r\n\/\/ OUTPUT \"COLUMN = \" & CurrentPositionC\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\/\/ FUNCTION Left(CurrentPositionR: INTEGER) RETURNS INTEGER\r\n\/\/ ChangedPositionC \u2190 1\r\n\/\/ CurrentPositionR \u2190 CurrentPositionR - 1\r\n\/\/ RETURN CurrentPositionR\r\n\/\/ ENDFUNCTION\r\n\r\nDECLARE A2D : ARRAY [1:4,1:4] OF STRING\r\n\r\nA2D[1,1] \u2190 \"\"\r\nA2D[3,3] \u2190 \"X\"\r\n\r\nDECLARE RP, CP : INTEGER\r\nDECLARE Move : CHAR\r\nRP \u2190 1\r\nCP \u2190 1\r\n\r\nIF A2D[RP, CP] = \"X\" THEN\r\n OUTPUT \"FOUND at position Row=\" & RP & \" and Col=\" & CP\r\n ELSE\r\n OUTPUT \"Not FOUND at position Row=\" & RP & \" and Col=\" & CP\r\n REPEAT\r\n OUTPUT \"Press W\/S\/A\/D\"\r\n INPUT Move\r\n IF Move = \"W\" THEN\r\n OUTPUT \"I am at Row =\" & Up(RP) & \" and Col=\" & CP\r\n RP \u2190 Up(RP)\r\n CP \u2190 CP\r\n ENDIF \r\n\r\n IF Move = \"S\" THEN\r\n OUTPUT \"I am at Row =\" & Dn(RP) & \" and Col=\" & CP\r\n RP \u2190 Dn(RP)\r\n CP \u2190 CP\r\n ENDIF \r\n\r\n IF Move = \"A\" THEN\r\n OUTPUT \"I am at Row =\" & RP & \" and Col = \" & Lt(CP)\r\n RP \u2190 RP\r\n CP \u2190 Lt(CP) \r\n ENDIF \r\n\r\n IF Move = \"D\" THEN\r\n OUTPUT \"I am at Row =\" & RP & \" and Col =\" & Rt(CP)\r\n RP \u2190 RP\r\n CP \u2190 Rt(CP) \r\n ENDIF \r\n UNTIL Move = \"X\" \r\nENDIF\r\n\r\n\r\n\r\nFUNCTION Up(RP:INTEGER) RETURNS INTEGER\r\n DECLARE IamAt : INTEGER\r\n RP \u2190 RP - 1\r\n RETURN RP\r\nENDFUNCTION\r\n\r\nFUNCTION Dn(RP:INTEGER) RETURNS INTEGER\r\n DECLARE IamAt : INTEGER\r\n RP \u2190 RP + 1\r\n RETURN RP\r\nENDFUNCTION\r\n\r\nFUNCTION Lt(CP:INTEGER) RETURNS INTEGER\r\n DECLARE IamAt : INTEGER\r\n CP \u2190 CP - 1\r\n RETURN CP\r\nENDFUNCTION\r\n\r\nFUNCTION Rt(CP:INTEGER) RETURNS INTEGER\r\n DECLARE IamAt : INTEGER\r\n CP \u2190 CP + 1\r\n RETURN CP\r\nENDFUNCTION","t":"11SC"}
{}
0478
4ooQ7