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);
}
}
}