Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For challenges that involve the physical layout or physical manipulation of source-code.
7
votes
Code 3k to Codee k
Python 2, 9 bytes
print 3&3
Try it online! Prints 3.
print 3&33
Try it online! Prints 1.
36
votes
Code 3k to Codee k
Many languages, 4 bytes
16-1
Outputs 15.
16-11
Outputs 5.
This is a CW answer for many languages it works for. Edit to add to the list:
APL
bc
Dyvil
Haskell
I
J
Japt
Javascript REPL
Java REPL …
1
vote
Third time the charm
Python 2, 38 bytes
1
id=id<3and-~id
exec"print id|1"*0**0
Try it online! (doubled, tripled)
Outputs 1, 1, or 3.
Python 2, 33 bytes
1
True+=1
exec"print 7%True"*0**0
Try it online! (doubl …
48
votes
Accepted
Write a Rectangular Program that Outputs the Number of Times it was Rotated
APL (1x3 = 3)
5!3
This solution uses the extra rule that any output that is correct mod 4 works.
In APL, x!y is the number of way to choose x elements from y, commonly known as binom(y,x) or choos …
59
votes
Code close to the challenge: Sum of integers
Python, distance 3
#Given a set of integers, find the
sum#of all integers in it.
This gives the built-in function sum, which can sum a set like sum({3,5,7})==17. The remaining parts are commente …
10
votes
Program your favorite phrase
Python 2 (37)
After Sarah became president of her local Mensa chapter, she became a focus of romantic attention from men looking for an intelligent partner. On every date, Sarah would try to make a p …
16
votes
Join N copies of a snippet to produce N^2 characters
Python 2, 22
a='';print a;a+='xx';a
Prints the empty string, then two x's, then x' four and so on. With the newline after each string, this comes out to n*n characters.
One copy: "\n" (1 char)
Two …
14
votes
Create a square of increasing size by replicating the initial code
Python 2, 22 bytes
i=0;i+=1; i
print'*'*i
Try it online!
Doubled:
i=0;i+=1; ii=0;i+=1; i
print'*'*i
print'*'*i
Note that the second half starts with a newline character.
10
votes
Which character to change (Robbers)
Python 3, 53 bytes, cracks dingledooper's 51 bytes
r=(1,)*8**9
r=r,len,str=r,str,sum
print(len(str(r)))
Try it online!
Replaces the newline at the end of the second line with st. This is LATIN SMALL L …
9
votes
Jumblers vs Rebuilders: Coding with Tetris Bricks
Python 3: 212 area [Rebuilt]
My code is broken up into the following 53 I-pieces, which I've written one per line alphabetically.
(358
0048
0396
0796
0824
0981
1013
1314
1330
1438
1502
2285
2317
247 …
3
votes
Jumblers vs Rebuilders: Coding with Tetris Bricks
Python 3: 340 area [Rebuilt]
Made of 85 I-pieces, given here alphabetized one per line.
#Four spaces
#Four spaces
#Four spaces
#Four spaces
#Four spaces
#Four spaces
#Fou …
3
votes
Jumblers vs Rebuilders: Coding with Tetris Bricks
Python 3: 160 area
After feersum's crack, I tried to tighten up my code to make it harder to avoid cryptographic mumbo-jumbo. It's made of 40 I pieces, listed one per row:
') #Two spaces
)-d)
*'T …
5
votes
A well linked challenge
Python 2, 74 bytes
bmn0=f=lambda s,P={0},d=[]:s<" "if(P in d)else+f(s[f<s:],P^{s[0^0]},[P]+d)
Try it online!
Iterates through the string, keeping track in P of the set of characters seen an odd …
6
votes
A well linked challenge
Python 3.8 (pre-release), 66 bytes
lambda l,b={id}:len({str(b:=b^{c})for(c)in l})<len(l)#,<^fmnost{}#
Try it online!
The Era of Assignment Expressions is upon us. With PEP 572 included in Python …
10
votes
Which character to change (Cops)
Python 2, 23 bytes (cracked by dingledooper)
print min(0,0)>min(0,0)
Try it online!
Should print True. Please don't brute force, I think it's a nice puzzle to solve.
Bonus puzzle!
Python 2, 23 byte …