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

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

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 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

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: SharpPencil\n\/\/ * Date: 2026\/05\/04\n\/\/ * Description: A sequel to my first game, 'The Bird Knight'\r\n\/\/ A text-based adventure game\n\/\/ * Categories: Games\n\n@\r\nHi! Please pay attention\r\nThis game was too large to upload as one file, so I've split it into bits. If you would like to play, please:\r\n1) Open the code editor\r\n2) Copy and paste the different bits into it\r\n3) Ensure that you have all the bits, and that they are in the right order\r\n4) Ensure this part is not copied\r\n5) Ensure that code isn't automatically translated to keywords (Please do not convert 'Random' and any numbers into keywords\/line numbers)\r\n6) If you have any difficulties, make sure you are using the O-Level syllabus\r\n7) Have fun!\r\n@\r\n\r\nDECLARE Mana, M, ManaC, Strength, S, Leadership, L, Speed, SP, SkillPoints: INTEGER \/\/ Skills\r\nDECLARE Choice, End, Attack, Target, BuzzUsed2, Count: INTEGER \/\/ User Decisions\r\nDECLARE BeaChoice, WinChoice, StunChance, OppChance, Random, BeeAttack, Answer: INTEGER \/\/ Bot Decisions\r\nDECLARE SlashD, SmashD, PollenBeamD, FlapD, CocoonD, LanceD: REAL \/\/ Attack Damages\r\nDECLARE SlashC, SmashC, CocoonC, LanceC: INTEGER \/\/ Attack's Remaining\r\nDECLARE HP, DMG, BeaHP, BeaDMG, WinHP, WinDMG, OppHP, OppDMG, NestDMG, BeeDMG, BeeHP, HoneyDMG: REAL \/\/ Health & DMG\r\nDECLARE WinAngry, BeaAngry, CocoonProtec, MainBoss, WinDead, BeaDead, MaceFound, LanceFound, Nest, TAnswer, TheBees, ArmyBattle, HoneyUsed, BuzzUsed: BOOLEAN \/\/ True \/ False\r\n\r\n\/\/ Initilization\r\n\/\/ Skills\r\nStrength \u2190 0\r\nSpeed \u2190 0\r\nLeadership \u2190 0\r\nMana \u2190 0\r\n\r\n\/\/ HP's\r\nHP \u2190 800\r\nBeaHP \u2190 400\r\nWinHP \u2190 400\r\n\r\n\/\/ DMG's\r\nWinDMG \u2190 0\r\nBeaDMG \u2190 0\r\nOppDMG \u2190 0\r\n\r\n\/\/ Attacks Remaining\r\nSlashC \u2190 10\r\nSmashC \u2190 4\r\nCocoonC \u2190 3\r\nLanceC \u2190 4\r\n\r\nTarget \u2190 0\r\nBuzzUsed2 \u2190 0\r\nCount <- 0\r\n\r\n\/\/ True \/ False\r\n\/\/ Checks where the butterfly is\r\nArmyBattle \u2190 FALSE\r\nTheBees \u2190 FALSE\r\nMainBoss \u2190 FALSE\r\n\r\n\/\/ Checks to see if certain moves were used, so that cooldowns will work, or bot actions can respond to what the butterfly did\r\nBuzzUsed \u2190 FALSE\r\nHoneyUsed \u2190 FALSE\r\nCocoonProtec \u2190 FALSE\r\n\r\nWinDead \u2190 FALSE\r\nBeaDead \u2190 FALSE\r\n\r\n\/\/ Toggles the enraged mode\r\nWinAngry \u2190 FALSE\r\nBeaAngry \u2190 FALSE\r\n\r\n\/\/ Checks to see if the butterfly found a weapon\r\nMaceFound \u2190 FALSE\r\nLanceFound \u2190 FALSE\r\n\r\nTAnswer \u2190 FALSE \/\/ Checks if the trivia answer was correct\r\n\r\n\/\/ Random Fight\r\nPROCEDURE RandomBird()\r\n OppDMG \u2190 (20 + ROUND(RANDOM() * 10, 0))\r\n IF BuzzUsed = TRUE THEN\r\n OppDMG \u2190 (OppDMG \/ 2)\r\n ENDIF\r\n OUTPUT \"The bird hits you for \", OppDMG\r\n HP \u2190 (HP - OppDMG)\r\nENDPROCEDURE\r\n\r\nPROCEDURE RandomEncounter()\r\n REPEAT\r\n OUTPUT \"---------------\"\r\n IF CocoonProtec = FALSE THEN\r\n CALL RandomBird\r\n ENDIF\r\n IF TheBees = TRUE THEN\r\n CALL BeeAttackMenu\r\n ENDIF\r\n OUTPUT \"Your HP: \", HP\r\n OUTPUT \"Opponent HP: \", OppHP\r\n OUTPUT \"---------------\"\r\n IF TheBees = TRUE THEN\r\n CALL BeeAttackChoice\r\n IF HoneyUsed = TRUE THEN\r\n CALL HoneyDamage()\r\n ENDIF\r\n ENDIF\r\n CALL AttackMenu\r\n CocoonProtec \u2190 FALSE\r\n CALL AttackChoice\r\n UNTIL OppHP <= 0 OR HP <= 0\r\nENDPROCEDURE\r\n\r\n\/\/ Crow Boss Fight\r\nPROCEDURE Crow()\r\n OppDMG \u2190 (30 + ROUND(RANDOM() * 10, 0))\r\n IF BuzzUsed = TRUE THEN\r\n OppDMG \u2190 (OppDMG \/ 2)\r\n ENDIF\r\n OUTPUT \"The crow smashes his mace down on you for \", OppDMG\r\n HP \u2190 (HP - OppDMG)\r\nENDPROCEDURE\r\n\r\nPROCEDURE CrowBoss()\r\n REPEAT\r\n OUTPUT \"---------------\"\r\n IF CocoonProtec = FALSE THEN\r\n CALL Crow\r\n ENDIF\r\n IF TheBees = TRUE THEN\r\n CALL BeeAttackMenu\r\n ENDIF\r\n OUTPUT \"Your HP: \", HP\r\n OUTPUT \"Crow HP: \", OppHP\r\n OUTPUT \"---------------\"\r\n CALL BeeAttackChoice\r\n IF TheBees = TRUE THEN\r\n CALL BeeAttackChoice\r\n IF HoneyUsed = TRUE THEN\r\n CALL HoneyDamage()\r\n ENDIF\r\n ENDIF\r\n CALL AttackMenu\r\n CocoonProtec \u2190 FALSE\r\n CALL AttackChoice\r\n UNTIL OppHP <= 0 OR HP <= 0\r\nENDPROCEDURE\r\n\r\n\/\/ Penguin Boss Fight\r\nPROCEDURE Penguin()\r\n OppDMG \u2190 (30 + ROUND(RANDOM() * 10, 0))\r\n IF BuzzUsed = TRUE THEN\r\n OppDMG \u2190 (OppDMG \/ 2)\r\n ENDIF\r\n OUTPUT \"The penguin charges at you, dealing \", OppDMG\r\n HP \u2190 (HP - OppDMG)\r\nENDPROCEDURE\r\n\r\nPROCEDURE PenguinBoss()\r\n REPEAT\r\n OUTPUT \"---------------\"\r\n IF CocoonProtec = FALSE THEN\r\n Random \u2190 (1 + ROUND(RANDOM() * 1, 0))\r\n IF Random = 1 THEN\r\n CALL Trivia\r\n ENDIF\r\n IF TAnswer = FALSE THEN\r\n CALL Penguin\r\n ELSE\r\n OUTPUT \"You dodged the penguin's charge\"\r\n ENDIF\r\n ENDIF\r\n IF TheBees = TRUE THEN\r\n CALL BeeAttackMenu\r\n ENDIF\r\n OUTPUT \"Your HP: \", HP\r\n OUTPUT \"Penguin HP: \", OppHP\r\n OUTPUT \"---------------\"\r\n CALL BeeAttackChoice\r\n IF TheBees = TRUE THEN\r\n CALL BeeAttackChoice\r\n IF HoneyUsed = TRUE THEN\r\n CALL HoneyDamage()\r\n ENDIF\r\n ENDIF\r\n CALL AttackMenu\r\n TAnswer \u2190 FALSE\r\n CocoonProtec \u2190 FALSE\r\n CALL AttackChoice\r\n UNTIL OppHP <= 0 OR HP <= 0\r\nENDPROCEDURE\r\n\r\nPROCEDURE Trivia()\r\n OUTPUT \"To dodge the penguin, you must do some trivia for some reason.\"\r\n Random \u2190 (1 + ROUND(RANDOM() * 2, 0))\r\n IF Random = 1 THEN\r\n OUTPUT \"What is meant by background radiation?\r\n1. The radiation that exists around us all the time\r\n2. The radiation emmited by photographs\"\r\n CALL Decision()\r\n IF Choice = 1 THEN\r\n TAnswer \u2190 TRUE\r\n ELSE\r\n TAnswer \u2190 FALSE\r\n ENDIF\r\n ENDIF\r\n IF Random = 2 THEN\r\n OUTPUT \"What is ecology?\r\n1. The study of the interactions between living organisms and their environment\r\n2. The study of economics\"\r\n CALL Decision()\r\n IF Choice = 1 THEN\r\n TAnswer \u2190 TRUE\r\n ELSE\r\n TAnswer \u2190 FALSE\r\n ENDIF\r\n ENDIF\r\n IF Random = 3 THEN\r\n OUTPUT \"What is a brute force attack?\r\n1. Bashing the password screen with a brick\r\n2. Trying all the different combinations of letters, symbols and numbers until you stumble on the password\"\r\n CALL Decision()\r\n IF Choice = 2 THEN\r\n TAnswer \u2190 TRUE\r\n ELSE\r\n TAnswer \u2190 FALSE\r\n ENDIF\r\n ENDIF\r\nENDPROCEDURE\r\n\r\n\/\/ King Crownelius\r\nPROCEDURE KingCrownelius()\r\n OppDMG \u2190 (10 + ROUND(RANDOM() * 10, 0))\r\n IF BuzzUsed = TRUE THEN\r\n OppDMG \u2190 (OppDMG \/ 2)\r\n ENDIF\r\n OUTPUT \"The king hits you for \", OppDMG\r\n HP \u2190 (HP - OppDMG)\r\nENDPROCEDURE\r\n\r\nPROCEDURE KingCrowneliusBoss\r\n REPEAT\r\n OUTPUT \"---------------\"\r\n IF CocoonProtec = FALSE THEN\r\n CALL RandomBird\r\n ENDIF\r\n IF TheBees = TRUE THEN\r\n CALL BeeAttackMenu\r\n ENDIF\r\n OUTPUT \"Your HP: \", HP\r\n OUTPUT \"King Crownelius' HP: \", OppHP\r\n OUTPUT \"---------------\"\r\n CALL BeeAttackChoice\r\n IF TheBees = TRUE THEN\r\n CALL BeeAttackChoice\r\n IF HoneyUsed = TRUE THEN\r\n CALL HoneyDamage()\r\n ENDIF\r\n ENDIF\r\n CALL AttackMenu\r\n CocoonProtec \u2190 FALSE\r\n CALL AttackChoice\r\n Count \u2190 (Count + 1)\r\n UNTIL Count = 2\r\nENDPROCEDURE\r\n\r\n\/\/ Main Boss Fight\r\n\/\/ Enraged Checker\r\nPROCEDURE BeakonceEnraged()\r\n IF BeaAngry = TRUE THEN\r\n BeaDMG \u2190 (BeaDMG + (ROUND(RANDOM() * 20, 0)))\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE WingstonEnraged()\r\n IF WinAngry = TRUE THEN\r\n WinDMG \u2190 (WinDMG + (ROUND(RANDOM() * 20, 0)))\r\n ENDIF\r\nENDPROCEDURE\r\n\r\n\/\/ Attack Target Checker\r\nPROCEDURE Aim()\r\n OUTPUT \"Who do you aim for?\"\r\n OUTPUT \"1. Beakonce (\",BeaHP,\" HP remaining)\"\r\n OUTPUT \"2. Wingston (\",WinHP,\" HP remaining)\"\r\n INPUT Target\r\n IF Target <> 1 AND Target <> 2 THEN\r\n REPEAT\r\n OUTPUT \"Invalid target. Please select either 1, or 2.\"\r\n INPUT Target\r\n UNTIL Target = 1 OR Target = 2\r\n ENDIF \r\n IF Target = 1 AND BeaHP <= 0 THEN\r\n OUTPUT \"Beakonce has already been defeated.\"\r\n Target \u2190 2\r\n ENDIF\r\n IF Target = 2 AND WinHP <= 0 THEN\r\n OUTPUT \"Wingston has already been defeated.\"\r\n Target \u2190 1\r\n ENDIF\r\nENDPROCEDURE\r\n\r\n\/\/ Bot Attacks\r\nPROCEDURE Beakonce()\r\n\tBeaChoice \u2190 (1 + ROUND(RANDOM() * 2, 0))\r\n\tIF BeaChoice = 1 THEN\r\n\t\tBeaDMG \u2190 (20 + ROUND(RANDOM() * 10, 0))\r\n CALL BeakonceEnraged\r\n\t\tHP \u2190 (HP - BeaDMG)\r\n\t\tOUTPUT \"Beakonce swings at you, dealing \", BeaDMG , \" DMG\"\r\n\tENDIF\r\n\tIF BeaChoice = 2 THEN \r\n\t\tBeaDMG \u2190 (15 + ROUND(RANDOM() * 10, 0))\r\n CALL BeakonceEnraged\r\n\t\tHP \u2190 (HP - BeaDMG)\r\n\t\tOUTPUT \"Beakonce dashes at you and bites you, dealing \", BeaDMG , \" DMG\"\r\n\tENDIF\r\n\tIF BeaChoice = 3 THEN\r\n\t\tBeaDMG \u2190 (30 + ROUND(RANDOM() * 20, 0))\r\n CALL BeakonceEnraged\r\n\t\tHP \u2190 (HP - BeaDMG)\r\n\t\tOUTPUT \"Beakonce whirls her head, throwing her sword with a spin, dealing \", BeaDMG , \" DMG\"\r\n\tENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE Wingston()\r\n WinChoice \u2190 (1 + ROUND(RANDOM() * 2, 0))\r\n IF WinChoice = 1 THEN\r\n WinDMG \u2190 (20 + ROUND(RANDOM() * 10, 0))\r\n CALL WingstonEnraged\r\n\t\tHP \u2190 HP - WinDMG\r\n\t\tOUTPUT \"Wingston slashes rapidly, dealing \", WinDMG , \" DMG\"\r\n\tENDIF\r\n\tIF WinChoice = 2 THEN \r\n\t\tWinDMG \u2190 (15 + ROUND(RANDOM() * 10, 0))\r\n CALL WingstonEnraged\r\n\t\tHP \u2190 HP - WinDMG\r\n\t\tOUTPUT \"Wingston lunges forward, and sinks his teeth into you, dealing \", WinDMG , \" DMG\"\r\n\tENDIF\r\n IF WinChoice = 3 THEN\r\n\t\tWinDMG \u2190 (40 + ROUND(RANDOM() * 10, 0))\r\n CALL WingstonEnraged\r\n HP \u2190 HP - WinDMG\r\n OUTPUT \"Wingston charges straight at you, holding his sword like a lance, dealing \", WinDMG , \" DMG\"\r\n DMG \u2190 (10 + ROUND(RANDOM() * 10, 0))\r\n WinHP \u2190 WinHP - DMG\r\n OUTPUT \"He grimaces as he takes \", DMG , \" DMG\" \r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE NestBrambles()\r\n NestDMG \u2190 (10 + ROUND(RANDOM() * 5, 0))\r\n HP \u2190 (HP - NestDMG)\r\n OUTPUT \"The materials in the nest dig into you like thorns, dealing \", NestDMG, \" DMG\"\r\nENDPROCEDURE\r\n\r\nPROCEDURE MainBossfight()\r\n MainBoss \u2190 TRUE\r\n\tREPEAT\r\n OUTPUT \"---------------\"\r\n IF BeaHP > 0 AND CocoonProtec = FALSE THEN\r\n CALL Beakonce\r\n ENDIF\r\n IF WinHP > 0 AND CocoonProtec = FALSE THEN\r\n CALL Wingston\r\n ENDIF\r\n IF Nest = TRUE AND CocoonProtec = FALSE THEN\r\n CALL NestBrambles\r\n ENDIF\r\n CALL AttackMenu\r\n OUTPUT \"Your HP: \", HP\r\n IF BeaHP > 0 THEN\r\n OUTPUT \"Beakonce HP: \", BeaHP\r\n ELSE\r\n OUTPUT \"Beakonce has been defeated.\"\r\n ENDIF\r\n IF WinHP > 0 THEN\r\n OUTPUT \"Wingston HP: \", WinHP\r\n ELSE\r\n OUTPUT \"Wingston has been defeated.\"\r\n ENDIF\r\n OUTPUT \"---------------\"\r\n CocoonProtec \u2190 FALSE\r\n CALL AttackChoice()\r\n IF BeaHP <= 0 AND WinHP > 0 AND BeaDead = FALSE THEN \r\n OUTPUT \"Beakonce charges at you, only to miss you barely and crash onto the floor. She twitches slightly, before remaining still. Wingston looks at her, a slow, singular tear running down his feathers.\"\r\n WinAngry \u2190 TRUE\r\n BeaDead \u2190 TRUE\r\n ENDIF\r\n IF WinHP <= 0 AND BeaHP > 0 AND WinDead = FALSE THEN \r\n OUTPUT \"Wingston flaps his wings hard, like he's about to charge, but he doesn't move. His eyes dazed, he slashes at the air rapidly, and falls onto his stomach. He looks up at you, his eyes staring into yours, before his head droops onto the floor. Beakonce looks at him, eyes wide.\"\r\n BeaAngry \u2190 TRUE\r\n WinDead \u2190 TRUE\r\n ENDIF\r\n UNTIL BeaHP <= 0 AND WinHP <= 0 OR HP <= 0\r\nENDPROCEDURE\r\n\r\n\/\/ Bee Attacks\r\nPROCEDURE Sting()\r\n BeeDMG \u2190 (8 + ROUND(RANDOM() * 5, 0))\r\n OppHP \u2190 (OppHP - BeeDMG)\r\n OUTPUT \"The bees attack, dealing \", BeeDMG, \" DMG\"\r\nENDPROCEDURE\r\n\r\nPROCEDURE Buzz()\r\n IF BuzzUsed = FALSE THEN\r\n IF ArmyBattle = TRUE THEN\r\n OUTPUT \"The bees swarm around your opponents, buzzing loudly. Your opponents are confused, and are unable to put all of their strength into their attacks.\"\r\n ELSE\r\n OUTPUT \"The bees swarm around your opponent, buzzing loudly. Your opponent is confused, and are unable to put all of their strength into their attack.\"\r\n ENDIF\r\n BuzzUsed \u2190 TRUE\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE Honey()\r\n HoneyDMG \u2190 (8 + ROUND(RANDOM() * 5, 0))\r\n IF HoneyUsed = FALSE THEN\r\n OUTPUT \"The bees coat the battleground in poisonous honey.\"\r\n HoneyUsed \u2190 TRUE\r\n ENDIF\r\nENDPROCEDURE\r\n\r\nPROCEDURE HoneyDamage()\r\n HoneyDMG \u2190 (8 + ROUND(RANDOM() * 5, 0))\r\n OppHP \u2190 (OppHP - HoneyDMG)\r\n OUTPUT \"The honey does \", HoneyDMG, \" DMG to all opponents on the battlefieldd\"\r\nENDPROCEDURE\r\n\r\nPROCEDURE BeeAttackMenu()\r\n OUTPUT \"---------------\"\r\n OUTPUT \"1. Sting - Make the bees sting your opponents\"\r\n IF BuzzUsed = FALSE THEN\r\n OUTPUT \"2. Buzz - Make the bees distract your opponents\"\r\n ELSE\r\n OUTPUT \"2. Buzz - The bees are too tired to buzz right now\"\r\n ENDIF\r\n IF HoneyUsed = FALSE THEN\r\n OUTPUT \"3. Honey - Make the bees coat the battlefield in honey\"\r\n ENDIF\r\n OUTPUT \"---------------\"\r\nENDPROCEDURE\r\n\r\nPROCEDURE BeeAttackChoice()\r\n IF BuzzUsed = TRUE THEN\r\n BuzzUsed2 \u2190 (BuzzUsed2 + 1)\r\n ENDIF\r\n IF BuzzUsed2 = 1 THEN\r\n BuzzUsed \u2190 FALSE\r\n BuzzUsed2 \u2190 0\r\n ENDIF\r\n REPEAT\r\n INPUT BeeAttack\r\n IF BeeAttack = 1 THEN\r\n CALL Sting()\r\n ENDIF\r\n IF BeeAttack = 2 THEN\r\n IF BuzzUsed = FALSE THEN\r\n CALL Buzz\r\n ELSE\r\n OUTPUT \"The bees attempt to buzz, but are too tired and fail.\"\r\n ENDIF\r\n ENDIF\r\n IF BeeAttack = 3 THEN\r\n IF HoneyUsed = FALSE THEN\r\n CALL Honey\r\n ELSE\r\n OUTPUT \"The battlefield is already covered!\"\r\n ENDIF\r\n ENDIF\r\n UNTIL BeeAttack > 0 AND BeeAttack < 4\r\nENDPROCEDURE","t":"The Butterfly Invasion (1)"}
{}
ALL