Skip to main content

New answers tagged

1 vote

1 bit, 2 bits, 3 bits, …

Nekomata + -n, 6 bytes ṖÞx→↕= Attempt This Online! ...
alephalpha's user avatar
  • 48.5k
2 votes

A bit of a digital XOR

R, 51 bytes \(n,`+`=\(b)n%/%b^rev(0:log(n,b))%%b)(+2*+10)[+2>0] Attempt This Online!
pajonk's user avatar
  • 16.7k
1 vote

A bit of a digital XOR

Pip, 11 bytes a@_X BMETBa Attempt This Online! Explanation ...
DLosc's user avatar
  • 39.7k
2 votes

A bit of a digital XOR

R, 75 bytes \(x,b=bitwAnd(x,e<-2^((log(x,2)%/%1):0))/e)(utf8ToInt(c(x,""))-48+0*b)[!!b] Attempt This Online! A function which inputs a number \$x\$ ...
int 21h Glory to Ukraine's user avatar
1 vote

Construct a uInt from an array of bits

TI-Basic, 13 bytes sum(Ans2^(dim(Ans)-cumSum(Ans! takes input as Ans (last result)
MarcMush's user avatar
  • 6,515
0 votes

Construct a uInt from an array of bits

PowerShell Core, 21 bytes $args|%{$s+=$_+$s} $s Try it online! Takes an array, returns an integer
Julian's user avatar
  • 3,118
2 votes

Construct a uInt from an array of bits

Perl 5 -p, 12 bytes $_=oct"0b$_" Try it online!
Xcali's user avatar
  • 15.3k
1 vote

Construct a uInt from an array of bits

dc, 4 bytes 2i?p Reads an array of 0 or 1 chars from stdin. Try it online!
Digital Trauma's user avatar
1 vote

Hoop, Hoop, Hoop, Hoop, Eye-Eye-Eye-Eye

05AB1E, 21 18 bytes [D_#<T‰`ˆ}TÞ¯R>×JC Port of @Neil's Charcoal answer, so make sure to upvote that answer as well! -3 bytes thanks to @Neil For a language ...
Kevin Cruijssen's user avatar
3 votes

Hoop, Hoop, Hoop, Hoop, Eye-Eye-Eye-Eye

JavaScript (Node.js), 41 bytes f=x=>x?(f(--x/10|0)+(e^=1)<<1+x%10)-e:e=0 Try it online!
l4m2's user avatar
  • 24.5k
3 votes

Hoop, Hoop, Hoop, Hoop, Eye-Eye-Eye-Eye

Charcoal, 31 bytes NθWθ«⊞υ∨﹪θχχ≔÷⊖θχθ»I⍘⭆⮌υק10κι² Try it online! Link is to verbose version of code. Explanation: ...
Neil's user avatar
  • 172k
1 vote

Hoop, Hoop, Hoop, Hoop, Eye-Eye-Eye-Eye

Jelly, 7 bytes ḃ⁵Jx$ḂḄ A monadic Link that accepts a non-negative integer and yields a non-negative integer. Try it online! Or see the test-suite. How? ...
Jonathan Allan's user avatar

Top 50 recent answers are included