Skip to main content
Commonmark migration
Source Link

#Perl 5 (-n), 41 40 bytes

Perl 5 (-n), 41 40 bytes

-1 byte thanls to Xcali

map{/01.*1/||say oct}glob"0b"."{0,1}"x$_

TIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • "0b". : concatenate to "0b"
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct : to convert to decimal and say

#Perl 5 (-n), 41 40 bytes

-1 byte thanls to Xcali

map{/01.*1/||say oct}glob"0b"."{0,1}"x$_

TIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • "0b". : concatenate to "0b"
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct : to convert to decimal and say

Perl 5 (-n), 41 40 bytes

-1 byte thanls to Xcali

map{/01.*1/||say oct}glob"0b"."{0,1}"x$_

TIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • "0b". : concatenate to "0b"
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct : to convert to decimal and say
added 37 characters in body
Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18

#Perl 5 (-n), 4141 40 bytes

-1 byte thanls to Xcali

map{/01.*1/||say oct"0b$_"oct}glob"glob"0b"."{0,1}"x$_

TIOTIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • "0b". : concatenate to "0b"
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct"0b$_"oct : to convert to decimal and say

#Perl 5 (-n), 41 bytes

map{/01.*1/||say oct"0b$_"}glob"{0,1}"x$_

TIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct"0b$_" : to convert to decimal and say

#Perl 5 (-n), 41 40 bytes

-1 byte thanls to Xcali

map{/01.*1/||say oct}glob"0b"."{0,1}"x$_

TIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • "0b". : concatenate to "0b"
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct : to convert to decimal and say
deleted 2 characters in body
Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18

#Perl 5 (-n), 41 bytes

map{/01.*1/||say oct"0b$_"}glob"{0,1}"x$_

TIOTIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct"0b$_" : to convert to decimal and say

#Perl 5 (-n), 41 bytes

map{/01.*1/||say oct"0b$_"}glob"{0,1}"x$_

TIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct"0b$_" : to convert to decimal and say

#Perl 5 (-n), 41 bytes

map{/01.*1/||say oct"0b$_"}glob"{0,1}"x$_

TIO

  • "{0,1}"x$_ : the string "{0,1}" repeated n times
  • glob : glob expansion (cartesian product)
  • map{...} : for each element
  • /01.*1/|| : to skip when 01 followed by something then 1
  • say oct"0b$_" : to convert to decimal and say
added 260 characters in body
Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18
Loading
Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18
Loading