Skip to main content
space between numbers
Source Link
Jo King
  • 48.1k
  • 6
  • 131
  • 187

R, 138114 114 bytes

x=function(){rev(rawToBits(rev(charToRaw(sprintf("x=%s;x()",gsub("\\s","",paste(deparse(x),collapse="")))))))};x()

Try it online!

Uses R’s ability to deparse functions to their character representation. The revs are needed because rawToBits puts the least significant bit first. as.integer is needed because otherwise the bits are displayed with a leading zero.

Edited once I realised that any convenient output was allowed. Also was out by one on original byte count.

R, 138114 bytes

x=function(){rev(rawToBits(rev(charToRaw(sprintf("x=%s;x()",gsub("\\s","",paste(deparse(x),collapse="")))))))};x()

Try it online!

Uses R’s ability to deparse functions to their character representation. The revs are needed because rawToBits puts the least significant bit first. as.integer is needed because otherwise the bits are displayed with a leading zero.

Edited once I realised that any convenient output was allowed. Also was out by one on original byte count.

R, 138 114 bytes

x=function(){rev(rawToBits(rev(charToRaw(sprintf("x=%s;x()",gsub("\\s","",paste(deparse(x),collapse="")))))))};x()

Try it online!

Uses R’s ability to deparse functions to their character representation. The revs are needed because rawToBits puts the least significant bit first. as.integer is needed because otherwise the bits are displayed with a leading zero.

Edited once I realised that any convenient output was allowed. Also was out by one on original byte count.

added 262 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

RR, 137138114 bytes

x=function(){cat(as.integer(rev(rawToBits(rev(charToRaw(sprintf("x=%s;x()",gsub("\\s","",paste(deparse(x),collapse="")))))))),sep="")};x()

Try it online!

Uses R’s ability to deparse functions to their character representation. The revs are needed because rawToBits puts the least significant bit first. as.integer is needed because otherwise the bits are displayed with a leading zero.

Try it online! Edited once I realised that any convenient output was allowed. Also was out by one on original byte count.

R, 137 bytes

x=function(){cat(as.integer(rev(rawToBits(rev(charToRaw(sprintf("x=%s;x()",gsub("\\s","",paste(deparse(x),collapse="")))))))),sep="")};x()

Uses R’s ability to deparse functions to their character representation. The revs are needed because rawToBits puts the least significant bit first. as.integer is needed because otherwise the bits are displayed with a leading zero.

Try it online!

R, 138114 bytes

x=function(){rev(rawToBits(rev(charToRaw(sprintf("x=%s;x()",gsub("\\s","",paste(deparse(x),collapse="")))))))};x()

Try it online!

Uses R’s ability to deparse functions to their character representation. The revs are needed because rawToBits puts the least significant bit first. as.integer is needed because otherwise the bits are displayed with a leading zero.

Edited once I realised that any convenient output was allowed. Also was out by one on original byte count.

Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

R, 137 bytes

x=function(){cat(as.integer(rev(rawToBits(rev(charToRaw(sprintf("x=%s;x()",gsub("\\s","",paste(deparse(x),collapse="")))))))),sep="")};x()

Uses R’s ability to deparse functions to their character representation. The revs are needed because rawToBits puts the least significant bit first. as.integer is needed because otherwise the bits are displayed with a leading zero.

Try it online!