Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automatically creates Flowcharts from IGCSE Pseudocode!

License

NotificationsYou must be signed in to change notification settings

MugilanGN/Flowchart-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatically creates Flowcharts from Pseudocode!

Video Demo

https://www.youtube.com/watch?v=1gCqPBzU8Z0

Installing through Repl.it

If you don't want to download this or setup python, you can run this project directly from your browser withrepl.it

This link will automatically clone the project and set it up for you. If you want to do it manually, you can importgithub.com/MugilanGN/Flowchart-Generator into repl.it yourself.

From here onwards, you can edit the enter.txt file in the repl project and replace it with your own custom pseudocode.

Once you are done, you can run the commands from theCLI Usage section of the README in the repl.it terminal.

Local Installation

This project was built on Python 3.7.4

Run this to install the necessary dependencies:

pip install Pillow==9.0.0 click

Next, clone this project onto your system.

Writing the Pseudocode

The Pseudocode is entered into a .txt file. It follows strict rules which must be obeyed

alt text

Rules

STOP and START are automatically input by the program, so do not need to be added

Indents don't affect the program, so nothing has to be indented, and incorrect indentation is allowed

The capitalization of the keywords is extremely important. If an error occurs, double check if you have capitalized the keywords like "TO" and "FOR" properly

ELSE IF is not available, but nested IFs are possible

The ENDIF, NEXT var, and ENDWHILE blocks are mandatory

Syntax Guide

Input and Output:

  • INPUT x
  • OUTPUT x
INPUT XOUTPUT varOUTPUT"hello"

IF statements:

  • IF condition THEN
  • ELSE
  • ENDIF
IF x< 3 THEN  OUTPUT XELSE  OUTPUT x*2ENDIF

The else statement is optional (ENDIF is still necessary)

IF x< 3 THEN OUTPUT XENDIF

Process-type blocks:

x = x + 1y = x / 2

While loops:

  • WHILE condition DO
  • ENDWHILE
WHILE x< 5 DO  OUTPUT xENDWHILE

For loops:

  • FOR var <- start TO end
  • NEXT var
FOR i<- 1 TO 5  OUTPUT iNEXT i

CLI usage

To run the code, simply execute the following command:

python Converter.py

Arguments

Arguments in the CLI are typed like so:--size=20 or--code="enter.txt"

  • --size is the font size used. This controls the size of the entire flowchart as well. By default it is 20px
  • --font is the font path. A default NotoSans font is used at "./fonts/", but can be changed for different OSs or fonts
  • --output is the flowchart's image file. Default is "flowchart.png"
  • --code is the file with the pseudocode. Defaults to "enter.txt"
  • --help provides CLI help

For example:

python Converter.py --code="code.txt" --size=30 --output="result.png"

Flowchart Image

This image contains the created flowchart which can be shared, printed, etc. Its size varies exactly on the size of the flowchart created, so it may even hit a resolution of 10k pixels! However if the generated flowchart is too big, then the image will be unopenable due to being too large. The user should be careful with flowchart sizes.

Support

If you are having issues, please let me know. You can contact me atmugi.ganesan@gmail.com

About

Automatically creates Flowcharts from IGCSE Pseudocode!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp