เมนูนำทาง
ภาษาซิมูลา โค้ดอย่างง่ายโปรแกรมอย่างน้อยที่สุด(มินิมัล)ของ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;
เมนูนำทาง
ภาษาซิมูลา โค้ดอย่างง่ายใกล้เคียง
ภาษาซิมูลาแหล่งที่มา
WikiPedia: ภาษาซิมูลา http://www.iro.umontreal.ca/~simula/ http://www.edelweb.fr/Simula/ http://staff.um.edu.mt/jskl1/talk.html http://heim.ifi.uio.no/~cim/sim_history.html http://heim.ifi.uio.no/~kristen/FORSKNINGSDOK_MAPP... http://www.cee.hw.ac.uk/~rjp/bookhtml/