← All guides
Nassi-Shneiderman structograms

Nassi-Shneiderman structogram: the full guide

A structogram (Nassi-Shneiderman diagram, NSD) shows an algorithm as nested boxes with no arrows. The whole logic reads top to bottom as a single block, which is why it is often required as an alternative to a flowchart. Below: every block shown visually, a live example, and how to build one from code in seconds.

The three building blocks

Any algorithm is these three, nested inside one another. No arrows — nesting shows the control flow directly.

Read x
y = x * 2
Print y
Sequence

Actions one after another — a stack of boxes, top to bottom.

x > 0?
YesNo
sign = +
sign = −
Branch

A condition splits into two columns, “Yes” on the left and “No” on the right.

while i < n
sum = sum + i
Loop

A frame wraps the repeated body on the top and left side.

A live example

Grading a score — a branch nested after an input. This is exactly what rombik outputs from code.

grade
Input score
score ≥ 90?
YesNo
Print «Excellent»
Print «Other»

Structogram vs flowchart

Same logic, two views. A structogram is more compact and arrow-free; a flowchart is more familiar to graders. rombik builds both from the same code — flip one toggle.

Flowchart per ISO 5807 — the full guide →

Make a structogram from code

Paste code in any of 10 languages, flip the “Structogram” toggle, and export to Word, Visio, draw.io, Typst, Excalidraw, SVG, PNG or PDF as native objects.