Given a string which is guaranteed to be either
composite, your program or function must return an integer \$100\le N\le 999\$ which meets this description.
- Your code must be deterministic.
- The choice of the integers is up to you. However, the six answers must be distinct. (For instance, if you return \$113\$ for odd, you cannot return \$113\$ for prime.)
- You may take the input string in full lower case (
odd), full upper case (
ODD) or title case (
Odd) but it must be consistent.
- This is code-golf.
Below is an example of valid I/O:
- odd → \$501\$
- even → \$140\$
- square → \$961\$ (\$=31^2\$)
- cube → \$343\$ (\$=7^3\$)
- prime → \$113\$
- composite → \$999\$ (\$=37\times 3\times 3\times 3\$)
For what it's worth, my own solution in JS is currently 24 bytes. So, brownie points for beating that.
Edit: I can now unveil it since it was found by tsh (just with a different parameter name):