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.
3
votes
Quineoid Triple - A(B) = C
JavaScript (ES6), 75 bytes (3 x 25)
Uses the same approach as most other answers.
// f1
s=>s.replace(/\d/,x=>x^1)
// f2
s=>s.replace(/\d/,x=>x^2)
// f3
s=>s.replace(/\d/,x=>x^3)
Try it online!
2
votes
Backhanded Compliments
JavaScript (ES6), 130 bytes
Early attempt. Not very satisfying.
f =/*> " P e r f e c t l y o k a*/y=>""+/**/(g=p=>(c=y[p])?m++%3?g(p+d):y[p+1]?c+g(p+d):c:g(p-d-d,d=-d))(m=0,d=1)
Try …
1
vote
Find the biggest chunk
JavaScript (ES7), score 3, 211 bytes
s =>( o=g =(X ,Y) =>m . map ((r ,y) =>r . map ((c ,x) =>c ==' '|| (1/ Y?( X-x )** 2+( Y-y )** 2-1 :k= 0) || g(x ,y, o=o >++ k?o :k, r[x ]=' ')) ))( m=s [ 's' + 'p …
30
votes
I reverse the source code, you negate the output!
JavaScript (V8), 19 bytes
print(1)//)1-(tnirp
Try it online!
almost identical to...
C# (Visual C# Interactive Compiler), 19 bytes
Print(1)//)1-(tnirP
Try it online!
(thanks to @someone …
7
votes
Hidden Inversions (Cops' Thread)
JavaScript (ES6), 21 bytes, Cracked
This is an easy one.
b=>Math.pow(b,torc=3)
Returns the cube of the input.
7
votes
I uppercase the source code, you reverse the input!
JavaScript (ES6), 46 bytes
Takes and returns an array of characters.
In lowercase
s=>s.map?s:s["\162\145\166\145\162\163\145"]()
Try it online!
In uppercase
S=>S.MAP?S:S["\162\145\166\145\162\163\1 …
8
votes
Hide the Needle in the Haystack (Cops)
JavaScript, 95 bytes (ES6), Cracked
A function returning a string.
f=(k=b=x=35)=>x--?f(k*74837258394056219&268435455):k&2?'N'+(k^124038877).toString(b):'Haystack'
"Haystack" demo
f=(k=b=x=35) …
2
votes
Hide the Needle in the Haystack (Cops)
JavaScript, 119 bytes (ES6), Cracked
A function returning a string. Quite long and not so hard, but hopefully fun.
_=>(+{}+['H'])[+[3]]+(+[][[]]+[])[+!!3]+(+[][[]]+['y'])[3]+(+[][[]]+['s'])[-~2]+(~! …
5
votes
Reverse source code and double the input
Trivial comment trick
JavaScript (ES6), 12 bytes
s=>s//s+s>=s
Try it online!
9
votes
Shrinking Triangles
JavaScript (ES6), Score 10 9
Below is an example starting point with 15 lines. Bigger triangles are obtained by padding the end with 0's while preserving the final `).
0
f=
_=>
`0
${`f=
`+f}`.
/* …
12
votes
Concatenated halting problem: no + no + ... = yes
JavaScript, 10 programs / 271 bytes
Saved 12+ bytes per program thanks to @tsh
This is similar to the method used by @darrylyeo in this answer.
o={get g(){while(k);},set go(_){k--;}};k=9;o.g
o={get g …
5
votes
Everyone Ought to Have a Friend
JavaScript (ES6), 0 (154 bytes)
Saved 2 4 bytes thanks to @ØrjanJohansen
Takes input as an array of strings.
s =>
s//=>(s,y,a
.map((s,y,a)=>[...s]
.map((c,x )=>[...s]
&&//++c,x
s[x+1]==c|
s[x-1]= …
4
votes
Repeat your program to print Fibonacci numbers
Node.js, 36 bytes, no header/footer
Returns the result in the exit code.
The highest possible value depends on the operating system. I think that's 8-bit/unsigned on Linux and at least 32-bit/signed o …
9
votes
Double it your way
JavaScript (ES6), 24 22 bytes
Despite its unusual format, this is the definition of an anonymous function, which can be either called directly or assigned to a variable.
+(g=x=>x*x)?g:(x=>x*2)
Try …
0
votes
The repetitive byte counter
JavaScript (ES6), 47 bytes
This is using the same technique as Benoit Esnard in this answer (from I double the source, you double the output!).
Prints 0 if n = 47 * M, or a non-zero value otherwise. …