Post History
C (gcc), 30 bytes f(x,y){return x+y|!(x^y|x^2);} Try it online! In case the "preferably on a function" requirement can be dropped, then #define f(x,y)x+y|!(x^y|x^2) is 28 bytes.
Answer
#2: Post edited
- # [C (gcc)], 30 bytes
- <!-- language-all: lang-c -->
- f(x,y){return x+y|!(x^y|x^2);}
- [Try it online!][TIO-kta5vxkd]
- [C (gcc)]: https://gcc.gnu.org/
[TIO-kta5vxkd]: https://tio.run/##S9ZNT07@/z9No0KnUrO6KLWktChPoUK7skZRoyKusqYizkjTuvZ/Zl6JQm5iZp6CRll@ZoomVzWXgkJBEVA0TUNJNSUmT0lHIU3DSMdIU9Mam4yhjiFOGWMcMgY6BjhkzMzMdEzAVtX@BwA "C (gcc) – Try It Online"
- # [C (gcc)], 30 bytes
- <!-- language-all: lang-c -->
- f(x,y){return x+y|!(x^y|x^2);}
- [Try it online!][TIO-kta5vxkd]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kta5vxkd]: https://tio.run/##S9ZNT07@/z9No0KnUrO6KLWktChPoUK7skZRoyKusqYizkjTuvZ/Zl6JQm5iZp6CRll@ZoomVzWXgkJBEVA0TUNJNSUmT0lHIU3DSMdIU9Mam4yhjiFOGWMcMgY6BjhkzMzMdEzAVtX@BwA "C (gcc) – Try It Online"
- ---
- In case the "preferably on a function" requirement can be dropped, then
- #define f(x,y)x+y|!(x^y|x^2)
- is 28 bytes.
#1: Initial revision
# [C (gcc)], 30 bytes <!-- language-all: lang-c --> f(x,y){return x+y|!(x^y|x^2);} [Try it online!][TIO-kta5vxkd] [C (gcc)]: https://gcc.gnu.org/ [TIO-kta5vxkd]: https://tio.run/##S9ZNT07@/z9No0KnUrO6KLWktChPoUK7skZRoyKusqYizkjTuvZ/Zl6JQm5iZp6CRll@ZoomVzWXgkJBEVA0TUNJNSUmT0lHIU3DSMdIU9Mam4yhjiFOGWMcMgY6BjhkzMzMdEzAVtX@BwA "C (gcc) – Try It Online"