- #1
Jamin2112
- 986
- 12
I'm writing a piece of code and I want to simplify a bunch of if/else statements.
I need f:{-1,1}x{-1,1}-->{1,2,3,4} with
f(1,-1)=1
f(1,1)=2
f(-1,1)=3
f(-1,-1)=4
Can anyone think of a mathematical function that will give me the desired output?
I need f:{-1,1}x{-1,1}-->{1,2,3,4} with
f(1,-1)=1
f(1,1)=2
f(-1,1)=3
f(-1,-1)=4
Can anyone think of a mathematical function that will give me the desired output?