bb94
  • Member for 8 years
  • Last seen more than a week ago
This isn't rocket science
30 votes

Perl 6, 75 bytes " |\n /_\\".say;" |$_|".say for slurp.chomp.comb;" |_|\n/___\\\n VvV".say;

View answer
Print the phrase "And she said, 'But that's his.'" using only the alphabet
24 votes

Perl 6, 1299 1272 1220 1215 bytes Thanks to Grimy for -27 bytes. -52 bytes because we didn't need the rabbit ears in the first place. Thanks to Jo King for -5 bytes. print chr flip chars i x chars ...

View answer
Abstract Rewriting Challenge (Robbers)
9 votes

boboquack For a given string, take all the letters (a = 0, b = 1, c = 2), sum them up and take the modulo 3. Then none of the rewrite rules change that value. The source string has a value of 1, and ...

View answer
Trick or Treat polyglot
7 votes

Perl / Perl 6, 41 bytes I don't believe they count as two versions of the same language; rather, I'll consider them different languages. my @a="ick";my $a="eat";print "tr$a[0]\n" Explanation This ...

View answer
Is it almost-prime?
5 votes

Setanta, 61 59 bytes gniomh(n){p:=2nuair-a n%p p+=1nuair-a n>1 n/=p toradh n==1} Try it here Notes: The proper keyword is gníomh, but Setanta allows spelling it without the accents so I did so to ...

View answer
Draw the Olympic Games logo
5 votes

TI-Basic (16 bytes) Note: TI-Basic is tokenized. If I remember correctly, ClrHome and Disp are one-byte tokens. ClrHome Disp "O O O"," O O

View answer
Fewest (distinct) characters for Turing Completeness
3 votes

Setanta, 14 characters adghimnort(){} Provides a way to encode the SKI combinator calculus as shown: i := gniomh(g){toradh(g)} k := gniomh(g){toradh(gniomh(n){toradh(g)})} s := gniomh(g){toradh(...

View answer
Stroke Count of a Chinese Numeral
3 votes

Setanta, 243 236 235 234 bytes gniomh(n){gniomh S(n,c){gniomh Q(t){s:=0ma t s=1toradh s}toradh(n&[13,1,2,3,5,4,4,2,2,2][n%10]+[0,2,6,3][n%10&c%4]+3*Q((c==4|c==8)&n%10000)-13*(Q(n%10==0&...

View answer
Make an error quine!
3 votes

Setanta, 97 bytes Eisceacht ar líne 1: Suíomh 19: Ag súil le uimhir, téacs, bool, athróg, liosta, nó gníomh. Try it here!

View answer
Factorize a Gaussian integer
3 votes

Perl 6, 141 124 bytes Thanks to Jo King for -17 bytes sub f($_){{$!=0+|sqrt .abs²-$^a²;{($!=$_/my \w=$^b+$a*i)==$!.floor&&.abs>w.abs>1>return f w&$!}for -$!..$!}for ^.abs;.say} ...

View answer
Find an Illegal String
3 votes

TI-Basic (83+/84+/SE, 24500 bytes) A (24500 times) TI(-83+/84+/SE)-Basic does syntax checking only on statements that it reaches, so even 5000 End statements in a row can be skipped with a Return. ...

View answer
Together Everyone Achieves More
3 votes

Perl6, 287 277 269 bytes my @w=$*IN.words;my ($q,$r)=gather for ^@w {my @v=@w.rotate($_);my \d=@v.shift;for @v.permutations {my @o=flat($_ Z d.comb).map:{$^a.index: $^b};take $_,@o if @o>>....

View answer
Output Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo
2 votes

Raku, 33 30 bytes put "BbBbbbBb".comb X~"uffalo" Try it online!

View answer
Golf you a quine for great good!
2 votes

Setanta, 254 bytes s:="s:=?q:='\"'n:=cuid@s(0,9)o:=cuid@s(9,fad@s)scriobh(athchuir@n(\"?\",q+athchuir@(athchuir@s(\"\\\\\",\"\\\\\\\\\"))('\"','\\\\\"'...

View answer
Make a bottom up poem
2 votes

Raku, 56 bytes {flat @_[^4].map(*.pick)xx^@_[4],"(Now read bottom up)"} Takes the list arguments in a list. Try it online!

View answer
The vanilla factorial challenge
2 votes

Setanta, 45 44 43 bytes gniomh F(n){ma n<2 toradh 1toradh n*F(n-1)} Try it here!

View answer
Print my clock's alarm sound
2 votes

Setanta, 146 144 140 124 123 bytes -16 bytes by using a cheaper check for the first beep. -1 byte by discovering that braces could be left out in one place. gniomh(n){s:=""le i idir(0,n){a:=(...

View answer
What's the file extension?
2 votes

Setanta, 66 34 bytes gniomh(s){toradh roinn@s(".")[-1]} Try it here!

View answer
Print all ASCII alphanumeric characters without using them
2 votes

Perl 6, 50 bytes {([~] '/'^..^':')~([~] '@'^..^'[')~[~] '`'^..^'{'} Block that returns the string since I don't think there's any way to print without using alphanumeric characters. Try it online!

View answer
Make all the squares explode
2 votes

Perl 6, 236 bytes {my@k=.flat;my \n=$_;loop {my (\i,\j)=@k>>.sqrt.grep({$_+|0==$_},:kv).rotor(2).max(*[1]);last if 0>i;$/=((0,1),(0,-1),(1,0),(-1,0)).map({$!=i+n*.[0]+.[1];+$!,n>.[0]+i/n&...

View answer
1-up your average quine
2 votes

Perl 6, 58 53 bytes Thanks to Jo King for -5 bytes. <say "<$_>~~.EVAL for 0..!.++;">~~.EVAL for 0..!.++; Based on Jo King's quine. Try it online!

View answer
UTF-8 Reduce Ascii art
2 votes

Perl 6, 159 chars (192 bytes) (|lines.map(*~' '),'')».comb(/../).rotor(2).map:{my@d=' 'xx.max(*.elems);say [~] map {"█▛▜▀▙▌▚▘▟▞▐▝▄▖▗ ".comb[:2(.trans([' ',/./]=>~⑩))]},[Z~] .map:{|$_,|@d}} Try ...

View answer
Amount of permutations on an NxNxN Rubik's Cube
2 votes

Perl 6, 85 bytes {0xAB4DE800000**($_%2)*3674160*([*] 1..24)**($_*($_-2)div 4)/24**(($_-2)**2 div 4*6)} Try it online!

View answer
Find i^n, given n
2 votes

Perl 6, 19 bytes - 5 = 14 {<1 i -1 -i>[$_%4]} The result of % has the same sign as the divisor in this language. Try it online!

View answer
Largest number in ten bytes of code
2 votes

Perl 6, 456,574 digits [*] 1..ↈ No TIO because it takes 2 minutes to run.

View answer
The sea in your terminal
2 votes

Perl 6, 140 138 137 123 120 bytes for ^Inf ->\i{print "\e[H";for 12,240,1984,6336,24672,32799 ->\j{say [~] map {j+>((i-$_)%16)%2??'*'!!' '},^80};sleep .1} Old solutions: for ^Inf ->\i {...

View answer
Hare Krishna Hare Krishna Krishna Krishna Hare Hare
2 votes

Perl 6, 61 60 my $a="Hare ";"$a$_ $a$_\n$_ $_ $a$a".say for <Krishna Rama>

View answer
Exploded view of a string
2 votes

Perl6, 48 47 45 slurp.comb.Bag.kv.map:{$^a.trim&&say $a x$^b} Thanks to manatwork for the improvements.

View answer
Number of Straight-Chain Alk*nes of given length
2 votes

Perl 6, 48 {my @a=1,0,0;@a=reverse [\+] @a for 1..$_;@a[0]} Originally sub f {$_>2??2*f($_-1)+f($_-2)-f($_-3)!!(1,1,3)[$_]} but I forgot I needed the sub f so the iterative solution wins out.

View answer
Shortest code that raises a SIGSEGV
2 votes

Perl 6, 22 shell "kill -11 $*PID" Just shelling to whatever shell you have.

View answer
1
2 3 4 5 6