Challenge:
Create a function or program that will take an input N (a number from 0 - 24) which represents the HOUR.
Output should draw an analog clock out of asterisks showing the hour N.
🕛🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛
Notes:
•The minute hand must be longer than the hour hand (in terms of number of asterisks used)
•The minute hand must be at least 2 asterisks.
•Noon, 3pm, 6pm, and 9pm will always be orthogonal. Your output for intermediary hours, when arranged by degrees, should be in the same order as the hours of the day. What I mean is at noon the hour hand is 0º and at 3pm the hour hand is 90º so for your output cases of 1pm and 2pm the following must be true: 0pm_deg < 1pm_deg < 2pm_deg < 3pm_deg
. Apart from this rule the actual degree amount can be whatever you decide, obviously it will change depending on font and other native factors.
•The connecting joint between the hour hand and minute hand is a circular/oval unicode character of any kind. o, O, •, 0, etc.
Example Input / Output (May vary depending on drawing styles)
N = 3;
*
*
*
O * *
N = 4;
*
*
*
O
*
*
N = 5;
*
*
*
0
*
*
N = 6;
*
*
o
*
N = 7;
*
*
*
•
*
*
N = 0,12,24;
*
*
*
o
Example of Differentiating Outputs:
N = 4 VS N = 5 VS N = 6
* * *
* * *
O O O
* * *
This is code-golf, so the program with the shortest bytecount wins!
3
be a different size than the minute hand for7
? \$\endgroup\$23:00
is11:00
. In my mind I was trying to loop around back to the 12 hand again \$\endgroup\$