Skip to content

[IGCSE Pseudocode Compiler] Output not showing before Input prompts #1

@AWyxa

Description

@AWyxa

I am an IGCSE student, taking Computer Science this year. This is the best Pseudocode compiler website I have found on the internet. Thank you for your effort for making this website.

I am facing this issue where the compiler is not showing the OUTPUT on the terminal before prompting me for an INPUT.
Here is my code:

DECLARE TotalPlayer:INTEGER
DECLARE TotalHoles:INTEGER
DECLARE CoursePar:INTEGER
DECLARE CorrectionOption:BOOLEAN

TotalPlayer ← 0

//Prints a message
OUTPUT "Please enter number of players (2, 3, 4): "
REPEAT
//Prompts for an input
INPUT TotalPlayer
IF TotalPlayer<2 OR TotalPlayer>4 THEN
//Prints a warning message if condition not met
OUTPUT "Please enter a number 2 to 4"
ENDIF
UNTIL TotalPlayer>=2 OR TotalPlayer<=4

DECLARE PlayerName:ARRAY[1:4] OF STRING
DECLARE PlayerIndex:INTEGER
FOR PlayerIndex ← 1 TO TotalPlayer
//Prints a message
OUTPUT "Please enter name of player", PlayerIndex
//Pauses and prompts an input
INPUT PlayerName[PlayerIndex]
NEXT PlayerIndex

REPEAT
//Prints a message
OUTPUT "Please enter a number of holes to be played (9 or 18): "
//Pauses to prompt for an input
INPUT TotalHoles
IF TotalHoles<>9 AND TotalHoles<>18 THEN
//Prints a warning
OUTPUT "Please enter 9 or 18."
ENDIF
UNTIL TotalHoles=9 OR TotalHoles=18

The compiler prompted me for inputs before printing any outputs without pause.

Expected behaviour:

  1. Outputs "Please enter number of players (2, 3, 4): "
  2. Prompts for an input (2, 3, 4 is to be accepted)
  3. If the input is not 2, 3 or 4, a warning message is outputted and input is prompted again.
  4. When input is valid, move on. If not, output a warning message and prompt input again.
  5. Outputs "Please enter name of player", PlayerIndex (player1, player2.... and so on)
  6. Prompts for an input
  7. Repeats until all player's names are input, move on
  8. Outputs "Please enter a number of holes to be played (9 or 18): "
  9. Prompts for an input, only 9 or 18 to be accepted.
  10. If input is not 9 or 18, a warning message is output and input is prompted again.
  11. If input is 9 or 18, move on.
  12. END of code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions