Skip to content

WhileLoop.sb

Kristian Virtanen edited this page Oct 31, 2024 · 2 revisions
// WhileLoop.sb in C# using SmallBasicOpenEditionDll
namespace SmallBasicOpenEditionDll.Classes
{
    class TestProgram
    {
        public static int x = 100;
        static void Main()
        {
            while (x > 0)
            {
                TextWindow.WriteLine(x);
                x /= 2;
            }
        }
    }
}
' WhileLoop.sb
number = 100
While (number > 0)
  TextWindow.WriteLine(number)
  number = number / 2
EndWhile
Clone this wiki locally