54
19
Let's make an ASCII art clock and calendar that tells us the current month, day of the month, day of the week, hour, minute, and whether it's night or day (but not the year or second).
At any particular time the calendar will look something like this: (it looks better with less line spacing)
________________________________________________________________
|\ ____________________________________________________________ /|
| | ___ | |
| | _( ) | |
| | (___)__) -.- | |
| | | |
| | | |
| | -.- | |
| | -.- | |
| | ___ | |
| | _( ) | |
| | (___)__) | |
| | | |
| | ___ | |
| | _( ) | |
| | _ (___)__) | |
| | /|\ | |
| | / | \ | |
| | /__|__\ | |
| |____|____ | |
| |\_______/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-~~-~~~~~| |
| |____________________________________________________________| |
|/______________________________________________________________\|
It is always a 66 by 23 character "picture frame" whose border never changes.
The image within the frame tells us the time and date:
- During the day (6:00am - 5:59pm) the month is determined by the number of birds (
-.-
) in the sky. January = 1 bird, February = 2 birds, etc. - During the night (6:00pm - 5:59am) the birds are replaced with 3 times as many stars (
*
). January = 3 stars, February = 6 stars, etc. Birds and stars are never in the sky at the same time. - The day of the month is determined by the number of characters between the two dashes (
-
) on the water. e.g.~~-~~~~-~~
means it is the fourth day of the month. Depending on the minute, the boat may need to be between the dashes (the dashes do not loop around). - The day of the week is determined by the number of clouds in the sky (all clouds look the same). Sunday = 0 clouds, Monday = 1 cloud, ..., Saturday = 6 clouds.
- The hour is determined by the level of water (and the boat). At its lowest (as above) it is 1 o'clock, during 2 o'clock it is one character higher, and so on up to 12 o'clock, then back to 1 o-clock. (It's a 12 not a 24 hour clock.)
- The minute is determined by the horizontal position of the boat. At the top of the hour the boat touches the left edge of the frame (as above). At each subsequent minute the boat moves right by one character. In minutes 51 to 59 it loops from the right side of the frame back to the left.
So, given that the example above has 3 birds, 3 clouds, 2 chars between dashes, the water at the lowest level, and the boat on the far left we can tell that the date is Wednesday March 2nd, and the time is 1:00pm.
Here is another example from Sunday April 25th, at 3:58am:
________________________________________________________________
|\ ____________________________________________________________ /|
| | | |
| | * * | |
| | * * * | |
| | * | |
| | | |
| | * | |
| | * * | |
| | | |
| | * | |
| | | |
| | * | |
| | _ | |
| | /|\ * | |
| |/ | \ | |
| |__|__\ /| |
| |__|____ __| |
| |______/~~~~~~~~~~~~~~~~~~~-~~~~~~~~~~~~~~~~~~~~~~~~~-~~~~~\_| |
| | | |
| | | |
| |____________________________________________________________| |
|/______________________________________________________________\|
Goal
Your goal is to write the shortest program possible that outputs these ASCII art "calendars" to stdout using the time when the program is run.
Every run of the program should output one time-scene. Updates should not be automatic (or animated).
The clouds, stars, and birds, should be placed randomly in the sky (so every run, even ones at the same time are likely to be different). They should never overlap the boat or each other. (Also the water dashes should not overlap the boat hull.)
Notice that nothing I have described appears underwater. This is for you to do. During one predetermined hour of every week (your choice), something interesting should be drawn underwater. It could be a sea monster or sunken ship or anything, it's up to you. During that hour you may even alter the design of the rest of the scene (staying in the frame bounds).
Scoring
This is a code-golf popularity-contest combo.
Your score is (bytes in program) - 4 * (upvotes - downvotes)
. The lowest score wins.
Use http://mothereff.in/byte-counter as a byte counter if you use non-ASCII characters.
Notes and Updates
You may use buoys instead of dashes, since, lets face it, they're much more appropriate:
| | ~~(_)~~~(_)~~ (3rd of the month)
The dashes (or buoys) do not have to be random but it would be nice if they were.
- Your "special hour" should last 60 minutes from the top of the hour to 1 minute before the next hour.
- During the special hour the things you draw underwater may move and may alter the surface and the sky when it makes sense (e.g. sea monster eating the boat, black hole forming at the sea floor, etc.)
21Would it be wrong of us to start downvoting all your questions/answers until you are back under 4k so you can continue posting awesome questions? – Kyle Kanos – 2014-08-12T02:10:59.963
How wonderfully fanciful. There's no point in me trying to golf it, but heck, I'm gonna try and write it (I'll still try and golf too). – AndoDaan – 2014-08-12T02:17:46.517
1@KyleKanos But then who would want to look at all my negatively score questions ;) – Calvin's Hobbies – 2014-08-12T02:20:51.967
4This seems like something used by Cold War spies to secretly communicate meeting times. – NinjaBearMonkey – 2014-08-12T02:51:29.870
Does the clock update as time passes, or do we have to re-run the program for an update? – Οurous – 2014-08-12T07:17:58.617
@Ourous You have to re-run the program for updates. (And the randomly placed clouds/birds/etc. don't need to stay in the same place for multiple runs in the same minute.) – Calvin's Hobbies – 2014-08-12T07:43:47.860
3Why not two buoys instead of dashes ? They'd be more visible and less out-of-place :) " |>\n~(_)~\n °" – Quentin – 2014-08-12T10:18:57.243
@Quentin I actually considered doing almost exactly that but the buoys didn't look right to me. – Calvin's Hobbies – 2014-08-12T11:27:03.117
You can always leave the buoys design to the participants :) – Quentin – 2014-08-12T11:30:16.150
@Quentin Tell you what. You're welcome to use simple buoys in place of dashes if you prefer. :) – Calvin's Hobbies – 2014-08-12T11:36:24.563
@MartinBüttner It should be birds from 6:00am to 5:59pm, then stars from 6:00pm to 5:59am. – Calvin's Hobbies – 2014-08-12T12:21:05.293
1@Calvin'sHobbies how random should the clouds, stars and birds be placed? Has it do be totally random across all free space, or is it enough if the output is different each run (so it would be random inside some constraints)? – tim – 2014-08-12T13:58:53.247
@Calvin'sHobbies If say, a person, is already coding while others are still asking for more and more specification, is the coder bound by those later specifications? – AndoDaan – 2014-08-12T14:13:30.143
@tim Having it random within reasonable constraints is fine. e.g. the stars look better near the top of the frame so it's ok to only draw them in the top few rows. What I DON'T want to see is
CLOUDCLOUDCLOUDCLOUDBIRDBIRDBIRDBIRD
all bunched in a line with no effort to position them realistically. Remember that this is partially a popularity content so the submissions with boring random positioning are not likely to be voted up. – Calvin's Hobbies – 2014-08-12T16:38:57.670@AndoDaan No, I won't be a stickler about that, but I think that my only strict adjustment so far was the 5:59 thing. – Calvin's Hobbies – 2014-08-12T16:41:40.203
4>
7 start="2">
@MartinBüttner Whoops, didn't see your other questions. The dashes do not have to be randomized but it would be nice if they didn't appear in the same spot all the time. During the special hour your underwater thing is allowed to change every minute and could even go above the surface when it makes sense (e.g. animating a sea monster swallowing the ship). – Calvin's Hobbies – 2014-08-13T02:29:08.620
Should've asked before doing it, but is it okay to change the water color during the hour? – Οurous – 2014-08-13T23:34:12.890
Won't it be too crowded to fit everything in the sky at 12am on a Saturday in December? – Tymric – 2014-08-15T13:48:27.357
@Ourous Thats fine – Calvin's Hobbies – 2014-08-15T16:59:17.050
@Timmy There's plenty of room. – Calvin's Hobbies – 2014-08-15T16:59:42.323