Make a program that takes a length and list of intervals and outputs a ruler of that length with longer ticks for each interval using the line drawing characters ┌ ┬ ┐ │ ╵
- The first row of the output should begin with the tick for 0 with
┌
and end with a tick for the length with┐
, with a┬
being used for every character in between. There will be a total oflength
+ 1 line drawing characters in this first row. - A tick should be lengthened vertically by half-character increments using
╵
and│
based on the input intervals. - Intervals are listed from smallest to largest, relative to the interval before it. To elaborate:
- The first interval tells how many base ticks (the first row - one character per tick) are in the second-smallest interval (the smallest interval being 1). For example, [3] will lengthen every third tick by a half-character.
- The second and subsequent intervals are in terms of the next smallest interval. For example [3, 5] will lengthen every 15th base tick by a full character and [3, 5, 2] will lengthen every 30th base tick by a character and a half.
- A sub-interval of 1 is valid and effectively means that the last interval lines are lengthened by a full character instead of a half-character.
- The example test cases should help to clarify how this works.
Examples/Test Cases
3, []:
┌┬┬┐
9, [3]:
┌┬┬┬┬┬┬┬┬┐
╵ ╵ ╵ ╵
30, [5, 2]:
┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐
│ ╵ │ ╵ │ ╵ │
32, [4, 2, 2, 2]:
┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐
│ ╵ │ ╵ │ ╵ │ ╵ │
│ ╵ │
48, [5, 3, 2]
┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐
│ ╵ ╵ │ ╵ ╵ │ ╵ ╵ │
╵ ╵
24, [7, 3]
┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐
│ ╵ ╵ │
17, [3, 2, 1]
┌┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┐
│ ╵ │ ╵ │ ╵
╵ ╵ ╵
1, [23, 19, 13, 11, 7, 5, 3, 2, 1]
┌┐
│
│
│
│
╵
Other Rules/Notes
- Input and output can use any convenient format
- The ruler doesn't have to end on a major tick
- The interval list may be empty
- The zeroth tick is always within all intervals.
- You may assume the ruler length and intervals will always be a positive integers less than 120
- Trailing whitespace is fine, but leading whitespace is not.
- Any fixed-single-wide space is allowed as a spacing character if you, for some reason, want to use something other than ASCII spaces.
Happy Golfing!