168 votes

Count of "a"s and "b"s must be equal. Did you get it computer?

Python 3, 32 bytes eval(input().translate(")("*50)) Try it online! Outputs via exit code: Error for false, no error for True. The string is evaluated as ...
xnor's user avatar
  • 145k
131 votes

Is this even or odd?

ArnoldC, 299 283 bytes ...
Luis Mendo's user avatar
  • 104k
121 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Dominoes, 122,000 bytes or 72 tiles The byte count is the size of the saved file which is 0.122 MB. Domino computing was the inspiration. I have tested all of ...
NonlinearFruit's user avatar
114 votes

"KNOT" or "NOT"?

Python 3, 457 316 306 bytes ...
Anders Kaseorg's user avatar
109 votes
Accepted

Java is to JavaScript as Car is to Carpet

Java/JavaScript Polyglot, 108 107 106 bytes //\u000As->s.matches("(?i)(?!.*javascript)java.*"/* a=>/(?!.*javascript)^java/i.test(a/**/)?"car":"carpet" Run ...
Olivier Grégoire's user avatar
108 votes

Detect MS Windows

MATLAB, 4 bytes ispc From the documentation: tf = ispc returns logical 1 (true) if the version of MATLAB® software is for ...
Stewie Griffin's user avatar
84 votes
Accepted

Detect MS Windows

Vim, 2 bytes <C-a>1 On Windows, <C-a> (ctrl+a) is mapped by default to ...
nmjcman101's user avatar
  • 3,674
81 votes

Magic the Gathering: Friends or Foes?

JavaScript (ES6),  26 23 17 15  14 bytes Takes input as two ASCII codes in currying syntax (a)(b). Returns 4 for ...
Arnauld's user avatar
  • 192k
73 votes

Am I being run backwards?

Python 3, no comments or string literals, 106 bytes x=quit y=x.__class__ y.__add__=print y.__pos__=x x+x++x+x x=__sop__.y tnirp=__dda__.y __ssalc__.x=y tixe=x I've ...
user2357112's user avatar
  • 1,660
71 votes

Is My Swipe Pattern Legal?

JavaScript (ES6), 64 bytes Takes input as an array of numbers. Falsy values are 0 or NaN. Truthy values are strictly positive integers. ...
Arnauld's user avatar
  • 192k
64 votes

Is it double speak?

Python 3, 24 bytes lambda s:s[::2]==s[1::2] Try it online!
Jitse's user avatar
  • 7,016
57 votes

I'm a palindrome. Are you?

Pyth, 3 bytes _I_ Returns True or False. Try it online! How it works ...
Dennis's user avatar
  • 210k
57 votes

Will it halt? (Cops)

Malbolge, 128 bytes, cracked by KBRON111 ...
Doorknob's user avatar
  • 71.5k
55 votes
Accepted

Is my prison secure?

Snails, 13 bytes !(t\P(o\ ),o~ Try it online! Prints 0 for insecure prisons and the size of the input's bounding box for ...
Martin Ender's user avatar
53 votes

Is this number a prime?

Hexagony, 28 bytes Since Etoplay absolutely trounced me on this question, I felt that I had to outgolf his only other answer. ...
H.PWiz's user avatar
  • 11.6k
52 votes

Is this even or odd?

brainfuck, 8 bytes +[,>,]<. Input is in unary. Output is the 1 (truthy) for odd numbers and NUL (falsy) for even numbers. Try it online! How it works We ...
Dennis's user avatar
  • 210k
52 votes

Will it halt? (Robbers)

Malbolge, Doorknob Try it online (Thanks Dennis!) Input for Windows: F_⌠1234567890 Input on Linux based system using ISO-8559-1: ...
KBRON111's user avatar
  • 581
51 votes
Accepted

Is it almost-prime?

Sagemath, 2 bytes GF Outputs via exception. Try it online! The Sagemath builtin \$\text{GF}\$ creates a Galois Field of order \$n\$. However, remember that \$\...
Sisyphus's user avatar
  • 14.8k
50 votes

As Easy as One-Two-Three

Python, 24 bytes range(123,790,111).count An anonymous function that outputs 0 or 1. It creates the list ...
xnor's user avatar
  • 145k
50 votes

I'm a palindrome. Are you?

Python, 39 bytes lambda s:s[::-1]==s#s==]1-::[s:s adbmal Try it online! Boring, but if there is shorter in Python it will be impressive.
Jonathan Allan's user avatar
49 votes

Golf all the 16 logic gates with 2 inputs and 1 output!

Hexagony, 89 bytes Thanks to FryAmTheEggman for some necessary inspiration for the XOR solution. ...
Martin Ender's user avatar
48 votes
Accepted

Is it a Proth number?

Jelly, 5 bytes ’&C²> Try it online! or verify all test cases. Let \$\newcommand{\&}[]{\text{ & }}j\$ be a strictly positive integer. \$j + 1\$ ...
Dennis's user avatar
  • 210k
48 votes

Is it a Proth number?

Python, 22 bytes lambda N:N-1&1-N>N**.5 This is a port of my Jelly answer. Test it on Ideone. How it works Let \$\newcommand{\&}[]{\text{ & }}j\$ ...
Dennis's user avatar
  • 210k
48 votes

Is my OS 32-bit or 64-bit?

x86 machine code, 12 bytes 8c c8 83 f8 23 b0 20 75 02 00 c0 c3 Ungolfed: ...
Ruslan's user avatar
  • 1,283
48 votes

Is It A Rainbow Color?

Haskell, 28 bytes (`elem`"albedo").(!!8).cycle Try it online! If we wrap the input and index at position 8, the ...
Lynn's user avatar
  • 68.7k
47 votes

Detect MS Windows

x86 Assembly, 7 bytes (Inspired by Runemoro's answer) 31 DB 89 D8 40 CD 80 Or xor ebx, ebx mov eax, ebx inc eax int 0x80 ...
Shmuel H.'s user avatar
  • 571
47 votes

An abundance of integers!

Regex (ECMAScript), 1085 855 597 536 511 508 504 bytes Matching abundant numbers in ECMAScript regex is an entirely different beast than doing so in practically any other regex flavor. The lack of ...
Deadcode's user avatar
  • 11.6k
45 votes
Accepted

Is my OS 32-bit or 64-bit?

x86 Assembly (polyglot), 13 bytes Bytecode: 31 c0 b4 80 48 70 05 04 40 83 e0 60 c3 Defines a function which returns 32 if interpreted as 32-bit, 64 if 64-bit, ...
ObsequiousNewt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible