##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.