Everybody loves geometry. So why don't we try and code golf it? This challenge involves taking in letters and numbers and making shapes depending on it.
The input will be in the form of
But what are shapeIdentifier, size, and inverter?
The shape identifier is the identifier for the type of shape you will be making with
*s. The following are the shape identifiers:
The size will be between
1-20, and it is the size of the figure.
The inverter is whether or not the shape will be upside down, which is denoted by a
+ or a
-. Do note:
s3- == (equals)
s3+ because squares are symmetric. However,
t5- != (does not equal)
Trailing whitespace is okay in the output but leading whitespace is not.
Input: s3+ Output: *** *** *** Input: t5+ Output: * *** ***** Input: t3- Output: *** *
The triangle input will always be an odd number, so the triangles will always end with 1
* at the top.
The size of the triangle is the size of the base if the inverter is
+and is the size of the top if the inverter is