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 |
Code-golf is a competition to solve a particular problem in the fewest bytes of source code.
4
votes
Implement a Truth-Machine
PowerShell, 16 15 bytes
for(;$args){1}0
Try it Online!
Edit:
-1 byte thanks to @AdmBorkBork
3
votes
The Letter A without A
Powershell, 11 bytes
" $(!2)"[2]
Every non-0 integer evaluates to True when casted to [bool].
!2 implicitly converts 2 to [bool] and negates it, so it becomes False.
$() blocks inside a string allo …
1
vote
The inverse Collatz Conjecture
PowerShell, 53 52 bytes
param($i)for(;$i){$i;$i=(($i*3+1),($i-shr1))[$i%2]}0
Try it Online!
Edit:
-1 byte thanks to @mazzy
4
votes
Palindromic palindrome generator
PowerShell, 67
$args|%{$_+-join$_[$_.Length..0]}#}]0..htgneL._$[_$nioj-+_${%|sgra$
Try it online
As suggested by @mazzy the code can be shortened by 12 bytes when using a static range. This, how …
2
votes
Am I not good enough for you?
Powershell, 46 bytes 43 bytes
param($i)1..$i|%{$o+=$_*!($i%$_)};$o-eq2*$i
Try it Online!
Edit:
-3 bytes thanks to @AdmBorkBork