Skip to main content
How on earth did I post the test code again?!
Source Link
VisualMelon
  • 3.9k
  • 18
  • 39
using System;

class P
{
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12,E=(int)t.DayOfWeek;
        var M=new char[60,19];
        
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };

        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        for(;++j<E;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}
        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}
        
        if(H==18&E==4)
            T(K(59),W+2,17,@"    __            __/  \_________ (_______________)");
        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
            
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        for(;;)
        {
            Console.Clear();
            //Console.Write(G(DateTime.Now));
            Console.Write(G(DateTime.Now.Add(new TimeSpan(28, 0, 0))));
            System.Threading.Thread.Sleep(15000);
        }
    }
}
using System;

class P
{
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12,E=(int)t.DayOfWeek;
        var M=new char[60,19];
        
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };

        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        for(;++j<E;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}
        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}
        
        if(H==18&E==4)
            T(K(59),W+2,17,@"    __            __/  \_________ (_______________)");
        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
            
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        for(;;)
        {
            Console.Clear();
            //Console.Write(G(DateTime.Now));
            Console.Write(G(DateTime.Now.Add(new TimeSpan(28, 0, 0))));
            System.Threading.Thread.Sleep(15000);
        }
    }
}
using System;

class P
{
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12,E=(int)t.DayOfWeek;
        var M=new char[60,19];
        
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };

        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        for(;++j<E;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}
        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}
        
        if(H==18&E==4)
            T(K(59),W+2,17,@"    __            __/  \_________ (_______________)");
        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
            
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        for(;;)
        {
            Console.Clear();
            Console.Write(G(DateTime.Now));
            System.Threading.Thread.Sleep(15000);
        }
    }
}
Put correct submarine code in
Source Link
VisualMelon
  • 3.9k
  • 18
  • 39

C# 1124bytes1124 1128bytes

Once a week, a shoddy ASCII submarine should appear for an hour below the waterline, and increase my byte count noticeably hopefully this code will actually work now. I dread to think what happens on Saturdays at 11:00 in December...

using System;class P{static string G(DateTime t){Func<int,int>K=new Random().Next;int i,j,D=t.Day,H=t.Hour,W=19-H%12;varH%12,E=(int)t.DayOfWeek;var M=new char[60,19];Func<int,int,int,string,bool>T=(x,y,w,s)=>{for(i=0;i<s.Length;)if(M[(x+i%w)%60,y+i++/w]>0)return 0>1;for(;i-->0;)M[(x+i%w)%60,y+i/w]=s[i];return 1>0;};T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");while(M[j=K(59-D),W]+M[j+D+1,W]>0){}M[j+D+1,W]=M[j,W]='-';for(j=60;j-->0;)T(j,W,1,"~");for(;j++<(int)t.DayOfWeek;;++j<E;)while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}var N=H<6|H>=18;for(j=0;j++<t.Month*(N?3:1);)while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}if(H==16&D==4H==18&E==4)T(K(59),W+2,1317,@"    __            __/  \_________ (_______________)");var res=" ________________________________________________________________\n|\\ ____________________________________________________________ /|\n| |";for(j=0;j<19;j++){for(i=0;i<60;i++)res+=M[i,j];res+="| |\n| |";}return res+"____________________________________________________________| |\n|/______________________________________________________________\\|";}static void Main(){Console.Write(G(DateTime.Now));}}
using System;

class P
{
    // calendar "printer"
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12;H%12,E=(int)t.DayOfWeek;
        var M=new char[60,19];
 
        // "plot" lambda, checks if there is room for a rectangle of chars
        // and sets them if there is
        //returning whether or not it did so
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };
 
        // boat
        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        // dashes
        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        // waterline
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        // clouds
        for(;++j<(int)t.DayOfWeek;;++j<E;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}
 
        // stars or birds        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}
 
        // submarine
        if(H==16&D==4H==18&E==4)
            T(K(59),W+2,1317,@"    __            __/  \_________ (_______________)");
 
        // frame and output        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
        
        // I simply can't be bothered to golf these strings
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        // boring loop
        //  - clears the terminal
        //  - prints the current datetimefor(;;)
        //  - sleeps for 15seconds{
        // exit with Ctrl-C
        forConsole.Clear(;;)
        {;
            //Console.ClearWrite(G(DateTime.Now));
            Console.Write(G(DateTime.Now.Add(new TimeSpan(28, 0, 0))));
            System.Threading.Thread.Sleep(15000);
        }
    }
}

C# 1124bytes

Once a week, a shoddy ASCII submarine should appear for an hour below the waterline, and increase my byte count noticeably. I dread to think what happens on Saturdays at 11:00 in December...

using System;class P{static string G(DateTime t){Func<int,int>K=new Random().Next;int i,j,D=t.Day,H=t.Hour,W=19-H%12;var M=new char[60,19];Func<int,int,int,string,bool>T=(x,y,w,s)=>{for(i=0;i<s.Length;)if(M[(x+i%w)%60,y+i++/w]>0)return 0>1;for(;i-->0;)M[(x+i%w)%60,y+i/w]=s[i];return 1>0;};T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");while(M[j=K(59-D),W]+M[j+D+1,W]>0){}M[j+D+1,W]=M[j,W]='-';for(j=60;j-->0;)T(j,W,1,"~");for(;j++<(int)t.DayOfWeek;)while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}var N=H<6|H>=18;for(j=0;j++<t.Month*(N?3:1);)while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}if(H==16&D==4)T(K(59),W+2,13,@"    __            __/  \_________ (_______________)");var res=" ________________________________________________________________\n|\\ ____________________________________________________________ /|\n| |";for(j=0;j<19;j++){for(i=0;i<60;i++)res+=M[i,j];res+="| |\n| |";}return res+"____________________________________________________________| |\n|/______________________________________________________________\\|";}static void Main(){Console.Write(G(DateTime.Now));}}
using System;

class P
{
    // calendar "printer"
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12;
        var M=new char[60,19];
 
        // "plot" lambda, checks if there is room for a rectangle of chars
        // and sets them if there is
        //returning whether or not it did so
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };
 
        // boat
        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        // dashes
        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        // waterline
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        // clouds
        for(;++j<(int)t.DayOfWeek;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}
 
        // stars or birds        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}
 
        // submarine
        if(H==16&D==4)
            T(K(59),W+2,13,@"    __            __/  \_________ (_______________)");
 
        // frame and output        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
        
        // I simply can't be bothered to golf these strings
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        // boring loop
        //  - clears the terminal
        //  - prints the current datetime
        //  - sleeps for 15seconds
        // exit with Ctrl-C
        for(;;)
        {
            Console.Clear();
            Console.Write(G(DateTime.Now));
            System.Threading.Thread.Sleep(15000);
        }
    }
}

C# 1124 1128bytes

Once a week, a shoddy ASCII submarine should appear for an hour below the waterline, and increase my byte count noticeably hopefully this code will actually work now. I dread to think what happens on Saturdays at 11:00 in December...

using System;class P{static string G(DateTime t){Func<int,int>K=new Random().Next;int i,j,D=t.Day,H=t.Hour,W=19-H%12,E=(int)t.DayOfWeek;var M=new char[60,19];Func<int,int,int,string,bool>T=(x,y,w,s)=>{for(i=0;i<s.Length;)if(M[(x+i%w)%60,y+i++/w]>0)return 0>1;for(;i-->0;)M[(x+i%w)%60,y+i/w]=s[i];return 1>0;};T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");while(M[j=K(59-D),W]+M[j+D+1,W]>0){}M[j+D+1,W]=M[j,W]='-';for(j=60;j-->0;)T(j,W,1,"~");for(;++j<E;)while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}var N=H<6|H>=18;for(j=0;j++<t.Month*(N?3:1);)while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}if(H==18&E==4)T(K(59),W+2,17,@"    __            __/  \_________ (_______________)");var res=" ________________________________________________________________\n|\\ ____________________________________________________________ /|\n| |";for(j=0;j<19;j++){for(i=0;i<60;i++)res+=M[i,j];res+="| |\n| |";}return res+"____________________________________________________________| |\n|/______________________________________________________________\\|";}static void Main(){Console.Write(G(DateTime.Now));}}
using System;

class P
{
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12,E=(int)t.DayOfWeek;
        var M=new char[60,19];
        
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };

        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        for(;++j<E;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}
        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}
        
        if(H==18&E==4)
            T(K(59),W+2,17,@"    __            __/  \_________ (_______________)");
        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
            
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        for(;;)
        {
            Console.Clear();
            //Console.Write(G(DateTime.Now));
            Console.Write(G(DateTime.Now.Add(new TimeSpan(28, 0, 0))));
            System.Threading.Thread.Sleep(15000);
        }
    }
}
Add submarine, as per spec
Source Link
VisualMelon
  • 3.9k
  • 18
  • 39

C# 1039bytes1124bytes

Just does the task, nothing more; I was hoping to add something newOnce a week, but it turns out I'm awful ata shoddy ASCII artsubmarine should appear for an hour below the waterline, so I gave up on thatand increase my byte count noticeably. I dread to think what happens on Saturdays at 11:00 in December...

using System;class P{static string G(DateTime t){Func<int,int>K=new Random().Next;int i,j,D=t.Day,H=t.Hour,W=19-H%12;var M=new char[60,19];Func<int,int,int,string,bool>T=(x,y,w,s)=>{for(i=0;i<s.Length;)if(M[(x+i%w)%60,y+i++/w]>0)return 0>1;for(;i-->0;)M[(x+i%w)%60,y+i/w]=s[i];return 1>0;};T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");while(M[j=K(59-D),W]+M[j+D+1,W]>0){}M[j+D+1,W]=M[j,W]='-';for(j=60;j-->0;)T(j,W,1,"~");for(;++j<;j++<(int)t.DayOfWeek;)while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}var N=H<6|H>=18;for(j=0;j++<t.Month*(N?3:1);)while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}varif(H==16&D==4)T(K(59),W+2,13,@"    __            __/  \_________ (_______________)");var res=" ________________________________________________________________\n|\\ ____________________________________________________________ /|\n| |";for(j=0;j<19;j++){for(i=0;i<60;i++)res+=M[i,j];res+="| |\n| |";}return res+"____________________________________________________________| |\n|/______________________________________________________________\\|";}static void Main(){Console.Write(G(DateTime.Now));}}
using System;

class P
{
    // calendar "printer"
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12;
        var M=new char[60,19];

        // "plot" lambda, checks if there is room for a rectangle of chars
        // and sets them if there is
        //returning whether or not it did so
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };

        // boat
        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        // dashes
        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        // waterline
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        // clouds
        for(;++j<(int)t.DayOfWeek;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}

        // stars or birds        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}

        // submarine
        if(H==16&D==4)
            T(K(59),W+2,13,@"    __            __/  \_________ (_______________)");

        // frame and output        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
        
        // I simply can't be bothered to golf these strings
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        // boring loop
        //  - clears the terminal
        //  - prints the current datetime
        //  - sleeps for 15seconds
        // exit with Ctrl-C
        for(;;)
        {
            Console.Clear();
            Console.Write(G(DateTime.Now));
            System.Threading.Thread.Sleep(15000);
        }
    }
}

C# 1039bytes

Just does the task, nothing more; I was hoping to add something new, but it turns out I'm awful at ASCII art, so I gave up on that. I dread to think what happens on Saturdays at 11:00 in December...

using System;class P{static string G(DateTime t){Func<int,int>K=new Random().Next;int i,j,D=t.Day,H=t.Hour,W=19-H%12;var M=new char[60,19];Func<int,int,int,string,bool>T=(x,y,w,s)=>{for(i=0;i<s.Length;)if(M[(x+i%w)%60,y+i++/w]>0)return 0>1;for(;i-->0;)M[(x+i%w)%60,y+i/w]=s[i];return 1>0;};T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");while(M[j=K(59-D),W]+M[j+D+1,W]>0){}M[j+D+1,W]=M[j,W]='-';for(j=60;j-->0;)T(j,W,1,"~");for(;++j<(int)t.DayOfWeek;)while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}var N=H<6|H>=18;for(j=0;j++<t.Month*(N?3:1);)while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}var res=" ________________________________________________________________\n|\\ ____________________________________________________________ /|\n| |";for(j=0;j<19;j++){for(i=0;i<60;i++)res+=M[i,j];res+="| |\n| |";}return res+"____________________________________________________________| |\n|/______________________________________________________________\\|";}static void Main(){Console.Write(G(DateTime.Now));}}
using System;

class P
{
    // calendar "printer"
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12;
        var M=new char[60,19];

        // "plot" lambda, checks if there is room for a rectangle of chars
        // and sets them if there is
        //returning whether or not it did so
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };

        // boat
        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        // dashes
        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        // waterline
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        // clouds
        for(;++j<(int)t.DayOfWeek;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}

        // stars or birds        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}

        // frame and output        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
        
        // I simply can't be bothered to golf these strings
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        // boring loop
        //  - clears the terminal
        //  - prints the current datetime
        //  - sleeps for 15seconds
        // exit with Ctrl-C
        for(;;)
        {
            Console.Clear();
            Console.Write(G(DateTime.Now));
            System.Threading.Thread.Sleep(15000);
        }
    }
}

C# 1124bytes

Once a week, a shoddy ASCII submarine should appear for an hour below the waterline, and increase my byte count noticeably. I dread to think what happens on Saturdays at 11:00 in December...

using System;class P{static string G(DateTime t){Func<int,int>K=new Random().Next;int i,j,D=t.Day,H=t.Hour,W=19-H%12;var M=new char[60,19];Func<int,int,int,string,bool>T=(x,y,w,s)=>{for(i=0;i<s.Length;)if(M[(x+i%w)%60,y+i++/w]>0)return 0>1;for(;i-->0;)M[(x+i%w)%60,y+i/w]=s[i];return 1>0;};T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");while(M[j=K(59-D),W]+M[j+D+1,W]>0){}M[j+D+1,W]=M[j,W]='-';for(j=60;j-->0;)T(j,W,1,"~");for(;j++<(int)t.DayOfWeek;)while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}var N=H<6|H>=18;for(j=0;j++<t.Month*(N?3:1);)while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}if(H==16&D==4)T(K(59),W+2,13,@"    __            __/  \_________ (_______________)");var res=" ________________________________________________________________\n|\\ ____________________________________________________________ /|\n| |";for(j=0;j<19;j++){for(i=0;i<60;i++)res+=M[i,j];res+="| |\n| |";}return res+"____________________________________________________________| |\n|/______________________________________________________________\\|";}static void Main(){Console.Write(G(DateTime.Now));}}
using System;

class P
{
    // calendar "printer"
    static string G(DateTime t)
    {
        Func<int,int>K=new Random().Next;
        int i,j,D=t.Day,H=t.Hour,W=19-H%12;
        var M=new char[60,19];

        // "plot" lambda, checks if there is room for a rectangle of chars
        // and sets them if there is
        //returning whether or not it did so
        Func<int,int,int,string,bool>T=(x,y,w,s)=>
        {
            for(i=0;i<s.Length;)
                if(M[(x+i%w)%60,y+i++/w]>0)
                    return 0>1;
            for(;i-->0;)
                M[(x+i%w)%60,y+i/w]=s[i];
            return 1>0;
        };

        // boat
        T(t.Minute,W-5,9,@"    _       /|\     / | \   /__|__\ ____|____\_______/");

        // dashes
        while(M[j=K(59-D),W]+M[j+D+1,W]>0){}
        M[j+D+1,W]=M[j,W]='-';
        
        // waterline
        for(j=60;j-->0;)
            T(j,W,1,"~");
        
        // clouds
        for(;++j<(int)t.DayOfWeek;)
            while(!T(K(53),K(W-3),8,"   ___   _(   ) (___)__)")){}

        // stars or birds        
        var N=H<6|H>=18;
        for(j=0;j++<t.Month*(N?3:1);)
            while(!T(K(60-(N?1:3)),K(W-1),3,N?"*":"-.-")){}

        // submarine
        if(H==16&D==4)
            T(K(59),W+2,13,@"    __            __/  \_________ (_______________)");

        // frame and output        
        var res=@" ________________________________________________________________
|\ ____________________________________________________________ /|
| |";

        for(j=0;j<19;j++)
        {
            for(i=0;i<60;i++)
                res+=M[i,j];
            res+="| |\n| |";
        }
        
        // I simply can't be bothered to golf these strings
        return res+@"____________________________________________________________| |
|/______________________________________________________________\|";
    }
    
    static void Main()
    {
        // boring loop
        //  - clears the terminal
        //  - prints the current datetime
        //  - sleeps for 15seconds
        // exit with Ctrl-C
        for(;;)
        {
            Console.Clear();
            Console.Write(G(DateTime.Now));
            System.Threading.Thread.Sleep(15000);
        }
    }
}
Fix Clouds
Source Link
VisualMelon
  • 3.9k
  • 18
  • 39
Loading
Fix code to comply with spec
Source Link
VisualMelon
  • 3.9k
  • 18
  • 39
Loading
Source Link
VisualMelon
  • 3.9k
  • 18
  • 39
Loading