Challenge
The shortest program by character count that accepts standard input of the form X-Y R
, with the following guarantees:
R
is a non-negative decimal number less than or equal to 8X
andY
are non-negative angles given in decimal as multiples of 45° (0
,45
,90
,135
, etc.)X
is less thanY
Y
is not360
ifX
is0
And produces on standard output an ASCII "arc" from the starting angle X
to the ending angle Y
of radius R
, where:
- The vertex of the arc is represented by
o
- Angles of
0
and180
are represented by-
- Angles of
45
and225
are represented by/
- Angles of
90
and270
are represented by|
- Angles of
135
and315
are represented by\
- The polygonal area enclosed by the two lines is filled with a non-whitespace character.
The program is not required to produce meaningful output if given invalid input. Solutions in any language are allowed, except of course a language written specifically for this challenge, or one that makes unfair use of an external utility. Extraneous horizontal and vertical whitespace is allowed in the output provided that the format of the output remains correct.
Happy golfing!
Numerous Examples
Input:
0-45 8
Output:
/ /x /xx /xxx /xxxx /xxxxx /xxxxxx /xxxxxxx o--------
Input:
0-135 4
Output:
\xxxxxxxx \xxxxxxx \xxxxxx \xxxxx o----
Input:
180-360 2
Output:
--o-- xxxxx xxxxx
Input:
45-90 0
Output:
o
Input:
0-315 2
Output:
xxxxx xxxxx xxo-- xxx\ xxxx\
0-315 2
is (to use the technical terms) a Pac-Man, not a pie slice. See example in edit. – Strangles