Search
Over on the Code Golf StackExchange site, there is a meta consensus that answers can be scored in fractional bytes if there exists such an encoding method. So, to quote the linked consensus questi...
Python 3, 35 bytes lambda m:list(zip(*m[::-1]))[::-1] Try it online! The format is a list of tuples. The content of the tuples could be any type; in my tests I used single-digit strings bec...
Japt, 2 bytes Input as a multi-line string ÕÔ Try it ÕÔ :Implicit input of string Õ :Transpose Ô :Reverse
J, 8 char Solution: |:|.|."1 Test example: (i. 3 3) 0 1 2 3 4 5 6 7 8 |:|.|."1 (i. 3 3) 8 5 2 7 4 1 6 3 0 (i. 4 2) 0 1 2 3 4 5 6 7 |:|.|."1 (i. 4 2) 7 5 3 1 6 4 2...
Rust, 425 bytes |a:T|a.iter().any(|b|a.iter().any(|c|c!=b&&f(&a,&vec![*b],&vec![*c])));fn g(a:&T,b:&T,c:&T,e:(i8,i8))->bool{[(0,1),(1,0),(-1,0),(0,-1)].iter().an...
Python 3, 145 bytes lambda s:[dict({chr(i+c):chr((i+13)%26+c)for i in range(26)for c in(65,97)},**{chr(i+48):chr((i+5)%10+48)for i in range(10)}).get(c,c)for c in s] Try it online! Generates...
C (gcc), 36 bytes f(int*p){for(;*p;putchar(32|*p++));} Try it online! Similar solutions: 36 bytes too but with new lines: f(int*p){for(;*p;*p|=32,puts(p++));} 37 bytes using recursion:...
Vyxal, 12 bytes bṠ:₍gGvc†Tİ∑ Try it Online! İ # Index into input T # Indices where v # For each Ṡ # Sum of b # Binary digits ₍gG ...
Python 3, 53 38 bytes def f(x,y): for c in x:print(end=c*y) Try it online! I'm sure someone will find a lambda solution to this. Golfed 15 bytes thanks to @Moshi's advice.
Python 3, 64 62 bytes for i in range(1,101):print("Fizz"*(i%3<1)+"Buzz"*(i%5<1)or i) Try it online! Saved two bytes thanks to Moshi in the comments.
Replace range() if $n < 4$ If you're using a for loop, you're probably using range() for the list count. You can actually replace it if the number inside range() is less than 4. Why? Examine th...
PHP, 58 28 bytes P1: <?="<?=\$argv[1]+$argv[1];"; Try it online! Golfed 30 bytes thanks to @Shaggy's advice. P2 (given I inputted 10): <?=$argv[1]+10; Try it online!
Rockstar, 44 bytes Outputs 1 for odd or 0 for even. listen to N let M be N/2 turn up M say M*2-N Try it here (Code will need to be pasted in)
Rockstar, 67 bytes listen to S split S O's"" while S roll S into C let O be C+O say O Try it here (Code will need to be pasted in)
PHP, 69 37 bytes <?=($y=sqrt($x=fgets(STDIN)))*$y==$x; Try it online! Golfed 32 bytes thanks to @Shaggy's advice.
C (gcc), 40 bytes i;f(n){for(i=1;n>0;n-=i,i+=2);return!n;} Try it online!
Combine loops Suppose you have a for loop in another, maybe a couple of times, and nothing else inside of the outer for loops (except for the first for loop since anything outside won't be involve...
* == and If you want to check if two booleans or integers and want to check if both of them are true in an if statement, then you can leave out and to replace it with *: x=2;y=3 if x and y:pri...
Use a+=[b] instead of a.append(b) The title says it all. a=[];b=10;print(a) a+=[b];print(a) Try it online!
This is a list of golfing tips for the language known as Philippine Peso PHP. If you have a tip, add it in!
Remove ?> You can save 2 bytes by removing the syntax that ends the PHP script when you don't need it. The program will still work. <?php echo"Hello!"; Try it online!