Skip to main content
Share Your Experience: Take the 2024 Developer Survey
36 votes

Woody words, tinny words

Python 2, 99 73 65 64 63 bytes lambda s:'PVC'*('ea'in s)or'wtoiondnyy'[s[-2:]in'instperit'::2] Try it online! Alternatives also with 63 bytes: ...
TFeld's user avatar
  • 19.8k
26 votes

Upgoat or Downgoat?

Python 3, OpenCV with Hough Transform, 100% My original idea was to detect the vertical lines of the goat's legs and determine its vertical position relative to the body and horizon. As it turns out, ...
qwr's user avatar
  • 12.1k
26 votes

What's my type? Well... Probably

Jelly, 181 bytes, accuracy 148/150, score ≈ 185.925 ...
25 votes

Do you know that language?

1. Retina, 0 bytes Try it online! The empty program prints 1 when given empty input (i.e. itself), because it counts how ...
Martin Ender's user avatar
22 votes

What's my type? Well... Probably

PHP, 5 bytes, score = 347.222 Correctly guesses 18 Pokemon. Water Try it online!
dingledooper's user avatar
  • 22.7k
18 votes

Is it truthy or falsy?

MATL, 20 bytes U|sG36ZA13\[BID1]m+g Input is a string enclosed in single quotes. Output is 1 for truthy or ...
Luis Mendo's user avatar
  • 105k
18 votes

Woody words, tinny words

Python 2, 62 bytes lambda n:'wtPoiVonCdn yy'[hash(n)%97%78%28%15%2+('ea'in n)::3] Try it online! How? This submission uses the fact that the ...
ovs's user avatar
  • 59.5k
17 votes
Accepted

Guess the language

C, 297 bytes, 43.194351% matched (v2) This is the first non-golf challenge I've competed in. Surprisingly, golfing languages are actually rather easy to separate, with about 60% matching accuracy per ...
owacoder's user avatar
  • 1,576
17 votes

Lossy or Lossless?

Jelly, 7 5 bytes ƈƈeØA Lossy formats return 0, lossless formats return 1. Try it online! (permalinks in Gist) Background The formats we have to support have ...
Dennis's user avatar
  • 210k
16 votes

Read ASCII-Art Text

Python 2, 405 335 234 182 171 bytes ...
ovs's user avatar
  • 59.5k
15 votes

Upgoat or Downgoat?

Python 3, numpy, scikit, 100% This code runs a goat-trained image classifier against a single filename, printing out 'Upgoat' or 'Downgoat'. The code itself is one line of python3, preceded by a ...
don bright's user avatar
  • 1,315
15 votes

Write a pluralization function for Russian

Python 2, 36 bytes lambda n:'5521'[n%~9/-3>>n/10%~9/-9] Try it online! Same length arithmetically: ...
xnor's user avatar
  • 145k
15 votes

Recognize a Roboto Mono character

Python 3, 211 209 bytes ...
AnttiP's user avatar
  • 7,898
14 votes

Who's that PRNG?

Jelly, 23 bytes ^Ḋṫ4^^æ«11$æ»31ż&2\ḂS<4 Takes an array of integers; returns [0, 1] for LCG, [1, 0] for Xorshift, and [0, 0] for MT. Try it online! (The ...
Dennis's user avatar
  • 210k
14 votes
Accepted

Read ASCII-Art Text

Jelly,  50 44  42 bytes ỴZ;6/UOḂḅ7‘ị“¥ŒƲVĊ⁾|W£⁼³ƭÇuʋụzḢĖ0ḢẆẠØsĠỌỊ» Try it online! (note the argument does not require the leading newline, but since leading and ...
Jonathan Allan's user avatar
14 votes

Is it a still-life?

APL (Dyalog Extended), 61 56 48 40 37 36 35 33 32 bytes 6∧+/w∘≢¨⊢∘⌂life\5/⊆w←0,∘⌽∘⍉⍣16⊢⎕ Try it online! Outputs 0 for still-life, 6 for oscillators, and 12 for ...
Razetime's user avatar
  • 27.2k
13 votes

Upgoat or Downgoat?

Scikit-learn with Random Forests, 100% The tried-and-true approach is convnets, but random forests can perform very well out-of-the-box (few parameters to tune). Here I show some general techniques ...
qwr's user avatar
  • 12.1k
13 votes

Do you know that language?

2. Brain-Flak, 22 bytes {<>(())(<>)}{}(<>{}()) Try it online! This checks the top of the stack and puts a one on the opposite stack if it is non-...
Wheat Wizard's user avatar
  • 98.8k
13 votes

Write a pluralization function for Russian

Python 2, 45 bytes lambda n,s='5122255555':(s+'5'*10+s*8)[n%100] Try it online!
Rod's user avatar
  • 18.4k
13 votes
Accepted

There's no such thing as a "half empty glass"

Retina, 56 bytes T%` l`!`^.*?#|[^#]+$ O` |\w *`! T`#!¶ *M` \w +` \w + Try it online! The output encoding is 0\n0 for ...
Martin Ender's user avatar
13 votes

Woody words, tinny words

JavaScript (ES6), Chrome/Edge, 54 bytes Because the behavior of parseInt() on large inputs with a radix of 36 is implementation-dependent, this one doesn't work ...
Arnauld's user avatar
  • 193k
13 votes

What's my type? Well... Probably

Node.js, score = 579 (579 bytes, 100%) This is at the other end of the spectrum, as opposed to @dingledooper's answer, as it gives the correct answer for all inputs. ...
Arnauld's user avatar
  • 193k
12 votes

Weird grading system

Javascript (ES6), 51 bytes n=>"ABCDEF"[(n<14)+(n<171)+(n<181)+(n<295)+(n<301)] Alternative solutions (longer): 53 52 bytes (-1 byte ...
Endenite's user avatar
  • 4,061
12 votes

Playing with the musical turtle

Java 8, 48 39 33 bytes s->"ROYGBRO BGYORBG".indexOf(s)|7 -6 bytes thanks to @RickHitchcock, so make sure to upvote him as well! Takes uppercase color ...
Kevin Cruijssen's user avatar
12 votes

Recognize a Roboto Mono character

Python 2, 150 149 147 140 136 133 bytes Takes the content of the pbm file as an argument. ...
ovs's user avatar
  • 59.5k
12 votes

What's my type? Well... Probably

jAvAscRIpt, 273 characters, score = 322.5425 This answer includes insincere rules-lawyering, but it doesn't seem to literally abuse a standard loophole. It might count as "adding input or rules&...
jan's user avatar
  • 321
11 votes

Thinking outside the box - Am I doing it right?

Javascript (ES6), 274 263 bytes ...
kyle1320's user avatar
  • 171
11 votes

Read ASCII-Art Text

JavaScript (ES6), 204 186 184 182 bytes Saved 18 bytes thanks to Neil Saved 2 bytes thanks to ETHproductions Saved 2 bytes thanks to YairRand Breakdown: 42-byte lookup table 162 144 142 140 bytes ...
Arnauld's user avatar
  • 193k
11 votes

Is it a still-life?

MATL, 42 38 31 29 bytes 2 bytes saved thanks to @Neil! 4thYaXJ4:"3Y6QZ+5:7mtJX=w]xvu Input is a binary matrix. Output is Still life: ...
Luis Mendo's user avatar
  • 105k

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