Skip to main content
Commonmark migration
Source Link

#C#, 128 127 Bytes

C#, 128 127 Bytes

using System;class P{static void Main(){for(;;)Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}");}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"));}}

#C#, 128 127 Bytes

using System;class P{static void Main(){for(;;)Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}");}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"));}}

C#, 128 127 Bytes

using System;class P{static void Main(){for(;;)Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}");}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"));}}
added 20 characters in body
Source Link

#C#, 128128 127 Bytes

using System;class P{static void Main(){for(;;)Console.Write("\r$"\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}");}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write("\r$"\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write("\r$"\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"));}}

#C#, 128 Bytes

using System;class P{static void Main(){for(;;)Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now);}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now));}}

#C#, 128 127 Bytes

using System;class P{static void Main(){for(;;)Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}");}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write($"\r{new DateTime(2019,3,31)-DateTime.Now:ddd\\:hh\\:mm\\:ss}"));}}
added 3 characters in body
Source Link

#C#, 127128 Bytes

using System;class P{static void Main(){for(;;)Console.Write("\r{0:ddd\\:h\\hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now);}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write("\r{0:ddd\\:h\\hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write("\r{0:ddd\\:h\\hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now));}}

#C#, 127 Bytes

using System;class P{static void Main(){for(;;)Console.Write("\r{0:ddd\\:h\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now);}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write("\r{0:ddd\\:h\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write("\r{0:ddd\\:h\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now));}}

#C#, 128 Bytes

using System;class P{static void Main(){for(;;)Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now);}}

Ungolfed code:

using System;
class P
{
    static void Main()
    {
        for(;;)
            Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now); 
    }
}

I would not have figured out the \r trick without help from the other C# answers here.

For anyone looking for further improvement, you can also put the Write() expression inside the for loop. Seems like I should be able to save a byte somehow here, because that saves me the semi-colon for that statement, but it works out to the same number because you can't have a fully empty body:

using System;class P{static void Main(){for(;;Console.Write("\r{0:ddd\\:hh\\:mm\\:ss}",new DateTime(2019,3,31)-DateTime.Now));}}
added 6 characters in body
Source Link
Loading
added 326 characters in body
Source Link
Loading
added 86 characters in body
Source Link
Loading
deleted 48 characters in body
Source Link
Loading
Source Link
Loading