In this challenge, you must take two numbers (separated by a space) as input and output an ASCII right triangle, made up of
The first number will be the width and height of the triangle you should output. The second number will be which corner the right angle will be in. The corners are numbered 1 to 4, starting in the top left and going in English reading order:
1 2 3 4
For example (inputs and their respective triangle outputs):
INPUT | 3 1 | 3 2 | 3 3 | 3 4 ------+-----+-----+-----+---- OUT- | xxx | xxx | x | x PUT | xx | xx | xx | xx | x | x | xxx | xxx
Your program's output must match these examples exactly for their respective inputs.
The input will always be valid: the first number will be an integer ≥1, and the second number will be 1, 2, 3, or 4.
This is code-golf; shortest code (in character count) wins.