a XAND b a AND b, but not at the same time. --- I've always found the idea of an XAND gate amusing. Many would claim such a gate can not exist, but I suspect they're just not trying hard enough. --- Popularity Contest You simply need to demonstrate an XAND gate. The rules are simple: Create two identifiers a and b They do not have to be primitives but can be anything [eg variables, functions, macros, constants, types, etc]. They must both be truthy by themselves [eg if (a)] They must fail to ...| Recent Questions - Code Golf Stack Exchange
Here is a game: Start with the set {1,2,3,...,n} of natural numbers. At any turn of the game, you may pick two numbers from this set, a and b, then replace them with their product a*b. Since it is a mathematical set, there will be only an occurrence for any number (duplicates are removed). The game continues until the set contains only one element, at which point we divide it by the least common multiple of 1,2,3,...,n, and that is the result of the game. This game was copied from a mathoverf...| Recent Questions - Code Golf Stack Exchange
(This challenge exists to extend sequence A276272 in the On-Line Encyclopedia of Integer Sequences, and perhaps create a new OEIS sequence1.) This is a code-challenge, which will have you write code to compute as many terms of this sequence as possible. --- Background A polytet is a kind of polyform which is constructed by gluing regular tetrahedra together face-to-face in such a way that none of the interiors of the tetrahedra overlap. These are counted up to rotation in 3-space but not refl...| Recent Questions - Code Golf Stack Exchange
We are all familiar with the famous Fibonacci sequence, that starts with 0 and 1, and each element is the sum of the previous two. Here are the first few terms (OEIS A000045): 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584 --- Given a positive integer, return the closest number of the Fibonacci sequence, under these rules: The closest Fibonacci number is defined as the Fibonacci number with the smallest absolute difference with the given integer. For example, 34 ...| Recent Questions - Code Golf Stack Exchange
Q&A for programming puzzle enthusiasts and code golfers| Code Golf Stack Exchange
Believe it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial...| Code Golf Stack Exchange