Skip to main content
golfed and ungolfed versions.
Source Link
Hywel Rees
  • 181
  • 1
  • 4

C# - DotNet core - 133 bytes

C# - DotNet core - 133 bytes

Golfed

class Program{static void Main(){int x=0,y=System.DateTime.Now.Year;while(x<121){System.Console.Write($"{y-x++}"+(x<121?", ":""));}}}

Ungolfed

class Program
{
    static void Main()
    {
        int x=0, y=System.DateTime.Now.Year;
        
        while(x<121)
        {
            System.Console.Write($"{y-x++}" + (x < 121 ? ", " : ""));
        }
    }
}

Output:

Output: enter image description here

I'm sure this can be improved. I don't particularly like the if statement to display or hide the trailing comma.

C# - DotNet core - 133 bytes

class Program{static void Main(){int x=0,y=System.DateTime.Now.Year;while(x<121){System.Console.Write($"{y-x++}"+(x<121?", ":""));}}}

Output: enter image description here

I'm sure this can be improved. I don't particularly like the if statement to display or hide the trailing comma.

C# - DotNet core - 133 bytes

Golfed

class Program{static void Main(){int x=0,y=System.DateTime.Now.Year;while(x<121){System.Console.Write($"{y-x++}"+(x<121?", ":""));}}}

Ungolfed

class Program
{
    static void Main()
    {
        int x=0, y=System.DateTime.Now.Year;
        
        while(x<121)
        {
            System.Console.Write($"{y-x++}" + (x < 121 ? ", " : ""));
        }
    }
}

Output:

enter image description here

I'm sure this can be improved. I don't particularly like the if statement to display or hide the trailing comma.

Source Link
Hywel Rees
  • 181
  • 1
  • 4

C# - DotNet core - 133 bytes

class Program{static void Main(){int x=0,y=System.DateTime.Now.Year;while(x<121){System.Console.Write($"{y-x++}"+(x<121?", ":""));}}}

Output: enter image description here

I'm sure this can be improved. I don't particularly like the if statement to display or hide the trailing comma.