20
1
You probably know what a Turing Machine is but do you know what is a Turning Machine (lathe)? Ok you already know.. and what about a Golf Turning Machine ??
Ok I tell you..
A Golf Turning Machine is a full program or function taking a list/array (or any convenient method) representing the Profile (P) of a turned piece and producing an ascii turned shape.
An ascii turned shape has square rotated by 45° cutting section instead of a circle so that we only need '/' and '\' characters to draw it. And it has '_' characters for the profiles: upper, lower and median.(like the one of this challenge : ASCII TURNED SHAPE ) for simple and nice drawing purpose.
_________
/\ \
/ \________\
\ / /
\/________/
A Profile P is a container of positive integers values in the range 0 <= value < 26(minimum)
- Every value represents the radius of a 1 long character section, so the length of the container is the length of the piece obtained.
- Alphabet are also valid [a to z] or [A to Z] they must correspond to a [0 to 25] value.
- 0 values at the beginning and at the end of the profile input can not be considered.
Test cases:
[2,2,2,2,2,4,4,4,4,4,6,6,6,6,6,4,4,4,4,4,2,2,2,2,2] or
"CCCCCEEEEEGGGGGEEEEECCCCC" or
['c','c','c','c','e',.....]
_____
/\ \
___/_ \ \__
/\ \ \ \ \
___/_ \ \ \ \ \__
/\ \ \ \ \ \ \ \
/ \____\ \____\ \____\_\_\
\ / / / / / / / /
\/____/ / / / / /_/
\ / / / / /
\/____/ / /_/
\ / /
\/____/
.
[1,0,0,0,0,0,0,3,3,0,0,1] or
[0,0,0,0,0,1,0,0,0,0,0,0,3,3,1,1,1,0,0,0]
__
/\ \
_ / \ \_
/\\ / \_\\
\// \ / //
\ / /
\/_/
.
[2,1,1,1,1,10,10,8,8,8,8,8,8,10,10,1,1,1,1,2]
__ __
/\ \ /\ \
/ \ \__/_ \ \
/ \ \ \ \ \
/ \ \ \ \ \
/ \ \ \ \ \
/ \ \ \ \ \
/ \ \ \ \ \
/ _ \ \ \ \ \
/ /\\___ \ \ \ \ \
/ / \\__\ \_\___\ \_\
\ \ //__/ / / / / /
\ \// / / / / /
\ / / / / /
\ / / / / /
\ / / / / /
\ / / / / /
\ / / / / /
\ / /___/ / /
\ / / \ / /
\/_/ \/_/
Rules :
- Margins are not specified.
- Standard loopholes are forbidden.
- Standard input/output methods.
- Shortest answer in bytes wins.
Sandbox https://codegolf.meta.stackexchange.com/a/18150/84844
Can we choose the number of trailing and leading zeroes? (inferring from test case 2) If so, we can require a amount of zeroes that happens to be the output converted from ASCII to unary. – my pronoun is monicareinstate – 2019-11-04T05:08:59.693
1@someone if you refer to the input nope – AZTECCO – 2019-11-04T06:49:53.277