Skip to main content
Commonmark migration
Source Link

##C#, 96 bytes

C#, 96 bytes


Golfed

()=>{for(int i=0;i++<11;)System.Console.WriteLine(System.Convert.ToString(i,2).PadLeft(4,'0'));}

Ungolfed

() => {
    for( int i = 0; i++ < 1; )
        System.Console.WriteLine( System.Convert.ToString( i, 2 ).PadLeft( 4, '0' ) );
}

Full code

using System;

namespace Namespace {
    class Program {
        static void Main( string[] args ) {
            m();

            Console.ReadLine();
        }

        static void m() {
            for( Int32 i = 0; i++ < 11; )
                Console.WriteLine(
                    Convert.ToString( i, 2 ). // Converts the number to binary code
                    PadLeft( 4, '0' ) );      // Fills the number with the missing '0's
        }
    }
}

Releases

  • v1.0 - 96 bytes - Initial solution.

##C#, 96 bytes


Golfed

()=>{for(int i=0;i++<11;)System.Console.WriteLine(System.Convert.ToString(i,2).PadLeft(4,'0'));}

Ungolfed

() => {
    for( int i = 0; i++ < 1; )
        System.Console.WriteLine( System.Convert.ToString( i, 2 ).PadLeft( 4, '0' ) );
}

Full code

using System;

namespace Namespace {
    class Program {
        static void Main( string[] args ) {
            m();

            Console.ReadLine();
        }

        static void m() {
            for( Int32 i = 0; i++ < 11; )
                Console.WriteLine(
                    Convert.ToString( i, 2 ). // Converts the number to binary code
                    PadLeft( 4, '0' ) );      // Fills the number with the missing '0's
        }
    }
}

Releases

  • v1.0 - 96 bytes - Initial solution.

C#, 96 bytes


Golfed

()=>{for(int i=0;i++<11;)System.Console.WriteLine(System.Convert.ToString(i,2).PadLeft(4,'0'));}

Ungolfed

() => {
    for( int i = 0; i++ < 1; )
        System.Console.WriteLine( System.Convert.ToString( i, 2 ).PadLeft( 4, '0' ) );
}

Full code

using System;

namespace Namespace {
    class Program {
        static void Main( string[] args ) {
            m();

            Console.ReadLine();
        }

        static void m() {
            for( Int32 i = 0; i++ < 11; )
                Console.WriteLine(
                    Convert.ToString( i, 2 ). // Converts the number to binary code
                    PadLeft( 4, '0' ) );      // Fills the number with the missing '0's
        }
    }
}

Releases

  • v1.0 - 96 bytes - Initial solution.
Source Link
auhmaan
  • 896
  • 5
  • 7

##C#, 96 bytes


Golfed

()=>{for(int i=0;i++<11;)System.Console.WriteLine(System.Convert.ToString(i,2).PadLeft(4,'0'));}

Ungolfed

() => {
    for( int i = 0; i++ < 1; )
        System.Console.WriteLine( System.Convert.ToString( i, 2 ).PadLeft( 4, '0' ) );
}

Full code

using System;

namespace Namespace {
    class Program {
        static void Main( string[] args ) {
            m();

            Console.ReadLine();
        }

        static void m() {
            for( Int32 i = 0; i++ < 11; )
                Console.WriteLine(
                    Convert.ToString( i, 2 ). // Converts the number to binary code
                    PadLeft( 4, '0' ) );      // Fills the number with the missing '0's
        }
    }
}

Releases

  • v1.0 - 96 bytes - Initial solution.