top of page

​

 

​

using System;

​

public class HelloWorld

{

public static void Main()

{

Console.WriteLine("Hello World!"); // relies on "using

System;"

Console.Write("This is");

Console.Write("... my first program!\n");

System.Console.WriteLine("Goodbye World!"); // no "using" statement

required

}

}

​

​

The above code displays the following text:

​

​

          Hello World!

          This is... my first program!

          Goodbye World!

​

The example program below shows a couple of ways to output text:

Build an egg timer using SnapsLibrary;

​​

​​class Ch03_12_EggTimerStart

{

 public void StartProgram()

 {

 SnapsEngine.SetTitleString("Egg Timer");

 SnapsEngine.DisplayString("There are five minutes left");

 SnapsEngine.Delay(60);

 SnapsEngine.DisplayString("There are four minutes left");

 }

}

​

bottom of page