New answers tagged

0

Lua, 82 bytes print(io.read():gsub(("%d"):rep(8),function(n)return'.'..tonumber(n,2)end):sub(2)) Try it online! Takes input from stdin and writes to stdout. Works on Lua 5.0+. This works by using string.gsub's ability to replace matches using a helper function. The function used here replaces a string of eight binary digits with a . followed by the ...


0

Fortran (GFortran), 58 bytes integer i(4) !Declare 4 int array read('(4B8)'),i !Read as 4 length 8 binary numbers print('(3(i0,"."),i0)'),i !Print as 3 auto-length ints followed by a '.' and then the last int end Try it online!


1

Julia, 58 52 bytes x->join(parse.(Int,x[n:n+7] for n=1:8:25;base=2),:.) Takes the input string and uses a comprehension to create an array of the 8 bits. Then parses each element (via 'broadcasting' with the . into an Int. Last step is to join with the period. Reductions per comments below: 4 byte reduction by simplifying the comprehension indexing 1 ...


Top 50 recent answers are included