12
Write a program or function that "reacts" to a given integer n (input via function parameter/args/stdin)
The program doesn't care about negative numbers, likes even, dislikes odd numbers and fears the number 13.
It should output the following:
if n<0:
--------------------------
| |
| |
(| _ _ |)
| |
| |
| |
| |
| oooooooooo |
| |
| |
| |
--------------------------
if n%2 == 0 and n>-1:
--------------------------
| |
| |
(| ^ ^ |)
| |
| |
| |
| o o |
| oooooooooo |
| |
| |
| |
--------------------------
if n%2 == 1 and n>-1 and n!=13:
--------------------------
| |
| |
(| > < |)
| |
| |
| |
| |
| oooooooooo |
| o o |
| |
| |
--------------------------
if n==13:
--------------------------
| |
| |
(| (O) (O) |)
| |
| |
| oooooooooo |
| o o |
| oooooooooo |
| |
| |
| |
--------------------------
The shortest solution in bytes wins.
213 is odd. Do we only output one face? Negatives are odd and even... – None – 2014-09-10T11:33:51.733
@MartinBüttner, in that case the first rule about negative numbers is completely unnecessary. The only priority which actually requires all of the rules is for the first and last ones to have priority over the middle ones. – Peter Taylor – 2014-09-10T11:46:30.827
@PeterTaylor oops, good point. – Martin Ender – 2014-09-10T11:47:28.057
@StandardToaster I edited the output conditions to avoid any misunderstandings – Markuz – 2014-09-10T11:53:19.637