Skip to main content
deleted 1306 characters in body
Source Link
Yousername
  • 4.1k
  • 4
  • 5

Convert angle to clock timeConvert angle to clock time

Your task is to make a program or function that takes an integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.

Rules

  • Output can be a list of times, or multiple outputs of times.
  • The times can be formatted in any way that can be identifiable as clock times by humans, such as hh:mm or a list of the hours and minutes.
  • Standard loopholes apply.
  • This is , so the shortest code in bytes in each language wins.

Test cases

Input    | Output
---------|------------
0        | 12:00
90       | 3:00, 9:00
180      | 6:00
45       | 4:30, 7:30
30       | 1:00, 11:00
60       | 2:00, 10:00
120      | 4:00, 8:00
15       | 5:30, 6:30
135      | 1:30, 10:30
1        | 4:22, 7:38
42       | 3:24, 8:36
79       | 3:02, 8:58
168      | 1:36, 10:24
179      | 1:38, 10:22

Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.

Convert angle to clock time

Your task is to make a program or function that takes an integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.

Rules

  • Output can be a list of times, or multiple outputs of times.
  • The times can be formatted in any way that can be identifiable as clock times by humans, such as hh:mm or a list of the hours and minutes.
  • Standard loopholes apply.
  • This is , so the shortest code in bytes in each language wins.

Test cases

Input    | Output
---------|------------
0        | 12:00
90       | 3:00, 9:00
180      | 6:00
45       | 4:30, 7:30
30       | 1:00, 11:00
60       | 2:00, 10:00
120      | 4:00, 8:00
15       | 5:30, 6:30
135      | 1:30, 10:30
1        | 4:22, 7:38
42       | 3:24, 8:36
79       | 3:02, 8:58
168      | 1:36, 10:24
179      | 1:38, 10:22

Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.

added 35 characters in body
Source Link
Yousername
  • 4.1k
  • 4
  • 5

Convert angle to clock time

Your task is to make a program or function that takes an integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.

Rules

  • Output can be a list of times, or multiple outputs of times.
  • The times can be formatted in any way that can be identifiable as clock times by humans, such as hh:mm or a list of the hours and minutes.
  • Standard loopholes apply.
  • This is , so the shortest code in bytes in each language wins.

Test cases

Input    | Output
---------|------------
0        | 12:00
90       | 3:00, 9:00
180      | 6:00
45       | 4:30, 7:30
30       | 1:00, 11:00
60       | 2:00, 10:00
120      | 4:00, 8:00
15       | 5:30, 6:30
135      | 1:30, 10:30
1        | 4:22, 7:38
42       | 3:24, 8:36
79       | 3:02, 8:58
168      | 1:36, 10:24
179      | 1:38, 10:22

Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.

Convert angle to clock time

Your task is to make a program or function that takes an integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.

Rules

  • Output can be a list of times, or multiple outputs of times.
  • The times can be formatted in any way that can be identifiable as clock times by humans, such as hh:mm.
  • Standard loopholes apply.
  • This is , so the shortest code in bytes in each language wins.

Test cases

Input    | Output
---------|------------
0        | 12:00
90       | 3:00, 9:00
180      | 6:00
45       | 4:30, 7:30
30       | 1:00, 11:00
60       | 2:00, 10:00
120      | 4:00, 8:00
15       | 5:30, 6:30
135      | 1:30, 10:30
1        | 4:22, 7:38
42       | 3:24, 8:36
79       | 3:02, 8:58
168      | 1:36, 10:24
179      | 1:38, 10:22

Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.

Convert angle to clock time

Your task is to make a program or function that takes an integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.

Rules

  • Output can be a list of times, or multiple outputs of times.
  • The times can be formatted in any way that can be identifiable as clock times by humans, such as hh:mm or a list of the hours and minutes.
  • Standard loopholes apply.
  • This is , so the shortest code in bytes in each language wins.

Test cases

Input    | Output
---------|------------
0        | 12:00
90       | 3:00, 9:00
180      | 6:00
45       | 4:30, 7:30
30       | 1:00, 11:00
60       | 2:00, 10:00
120      | 4:00, 8:00
15       | 5:30, 6:30
135      | 1:30, 10:30
1        | 4:22, 7:38
42       | 3:24, 8:36
79       | 3:02, 8:58
168      | 1:36, 10:24
179      | 1:38, 10:22

Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.

deleted 202 characters in body
Source Link
Yousername
  • 4.1k
  • 4
  • 5

Convert angle to clock time

Your task is to make a program or function that takes an integerinteger (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.

Rules

  • Output can be a list of times, or multiple outputs of times.
  • For theThe times, the hour number can have an optional 0 at the beginning of the number if the number is less than 10, but this is mandatory for the minutes number. The timebe formatted in any way that can either be a string with a separator between the hour and minutesidentifiable as clock times by humans, or a list of two strings representing the hour and minutessuch as hh:mm.
  • Standard loopholes apply.
  • This is , so the shortest code in bytes in each language wins.

Test cases

Input    | Output
---------|------------
0        | 12:00
90       | 3:00, 9:00
180      | 6:00
45       | 4:30, 7:30
30       | 1:00, 11:00
60       | 2:00, 10:00
120      | 4:00, 8:00
15       | 5:30, 6:30
135      | 1:30, 10:30
1        | 4:22, 7:38
42       | 3:24, 8:36
79       | 3:02, 8:58
168      | 1:36, 10:24
179      | 1:38, 10:22

Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.

Convert angle to clock time

Your task is to make a program or function that takes an integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.

Rules

  • Output can be a list of times, or multiple outputs of times.
  • For the times, the hour number can have an optional 0 at the beginning of the number if the number is less than 10, but this is mandatory for the minutes number. The time can either be a string with a separator between the hour and minutes, or a list of two strings representing the hour and minutes.
  • Standard loopholes apply.
  • This is , so the shortest code in bytes in each language wins.

Test cases

Input    | Output
---------|------------
0        | 12:00
90       | 3:00, 9:00
180      | 6:00
45       | 4:30, 7:30
30       | 1:00, 11:00
60       | 2:00, 10:00
120      | 4:00, 8:00
15       | 5:30, 6:30
135      | 1:30, 10:30
1        | 4:22, 7:38
42       | 3:24, 8:36
79       | 3:02, 8:58
168      | 1:36, 10:24
179      | 1:38, 10:22

Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.

Convert angle to clock time

Your task is to make a program or function that takes an integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.

Rules

  • Output can be a list of times, or multiple outputs of times.
  • The times can be formatted in any way that can be identifiable as clock times by humans, such as hh:mm.
  • Standard loopholes apply.
  • This is , so the shortest code in bytes in each language wins.

Test cases

Input    | Output
---------|------------
0        | 12:00
90       | 3:00, 9:00
180      | 6:00
45       | 4:30, 7:30
30       | 1:00, 11:00
60       | 2:00, 10:00
120      | 4:00, 8:00
15       | 5:30, 6:30
135      | 1:30, 10:30
1        | 4:22, 7:38
42       | 3:24, 8:36
79       | 3:02, 8:58
168      | 1:36, 10:24
179      | 1:38, 10:22

Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.

Source Link
Yousername
  • 4.1k
  • 4
  • 5
Loading