โค้ดอย่างง่าย ของ ภาษาซิมูลา

โปรแกรมอย่างน้อยที่สุด

โปรแกรมอย่างน้อยที่สุด(มินิมัล)ของSimula คือไฟล์ว่างเปล่า ซึ่งมีองค์ประกอบเพียง ; (ดัมมี่สเตทเมนท์) เพียงอย่างเดียว.แต่โปรแกรมอย่างน้อยที่สุดก็มักจะเขียนเป็นบล็อกว่างเปล่าตามความนิยมด้วยเช่นกัน

BeginEnd;

โปรแกรมนี้เริ่มรันและจบลงทันที. โดยในภาษาSimulaจะไม่มีการรีเทิร์นค่าเมื่อจบโปรแกรม.

คลาสสิกเฮลโลเวิลด์

โปรแกรมภาษาSimulaแบ่งแยกตัวอักษรเล็กและใหญ่(เคสเซนสิทีฟ) ตัวอย่างต่อไปนี้คือโปรแกรมเฮลโลเวิลด์ในภาษาSimula

Begin  OutText ("Hello World!");  Outimage;End;

ชั้น, ชั้นย่อย, และวิธีการเสมือน

A more realistic example with use of classes, subclasses and virtual methods:

Begin   Class Glyph;      Virtual: Procedure print Is Procedure print;;   Begin   End;   Glyph Class Char (c);      Character c;   Begin      Procedure print;        OutChar(c);   End;   Glyph Class Line (elements);      Ref (Glyph) Array elements;   Begin      Procedure print;      Begin         Integer i;         For i:= 1 Step 1 Until UpperBound (elements, 1) Do            elements (i).print;         OutImage;      End;   End;   Ref (Glyph) rg;   Ref (Glyph) Array rgs (1 : 4);   ! Main program;   rgs (1):- New Char ('A');   rgs (2):- New Char ('b');   rgs (3):- New Char ('b');   rgs (4):- New Char ('a');   rg:- New Line (rgs);   rg.print;End;