Skip to main content
Commonmark migration
Source Link

#Haskell, 154 149 147 145 128 120 119 117 bytes

Haskell, 154 149 147 145 128 120 119 117 bytes

import Data.List
(r%x)n|n>0&&r<":"=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!0|0<1=x
h=['0'..]%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"

#Haskell, 154 149 147 145 128 120 119 117 bytes

import Data.List
(r%x)n|n>0&&r<":"=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!0|0<1=x
h=['0'..]%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"

Haskell, 154 149 147 145 128 120 119 117 bytes

import Data.List
(r%x)n|n>0&&r<":"=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!0|0<1=x
h=['0'..]%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"
golfed a bit
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37

#Haskell, 154 149 147 145 128 120 119119 117 bytes

import Data.List
(r%x)n|n>0&&r>[]=[n|n>0&&r<":"=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!0|0<1=x
h=['0'..'9']%""]%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"

#Haskell, 154 149 147 145 128 120 119 bytes

import Data.List
(r%x)n|n>0&&r>[]=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!0|0<1=x
h=['0'..'9']%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"

#Haskell, 154 149 147 145 128 120 119 117 bytes

import Data.List
(r%x)n|n>0&&r<":"=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!0|0<1=x
h=['0'..]%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"
golfed one byte more
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37

#Haskell, 154 149 147 145 128 120120 119 bytes

import Data.List
(r%x)n|n<1||r==[]=x|0<1=[n|n>0&&r>[]=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!00|0<1=x
h=['0'..'9']%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"

#Haskell, 154 149 147 145 128 120 bytes

import Data.List
(r%x)n|n<1||r==[]=x|0<1=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!0
h=['0'..'9']%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"

#Haskell, 154 149 147 145 128 120 119 bytes

import Data.List
(r%x)n|n>0&&r>[]=[(r\\t)%(x++(show n\\t))$n-1|t<-tails x,isPrefixOf t$show n]!!0|0<1=x
h=['0'..'9']%""

adding in the recycling-checking cost a lot of characters... sigh

golfed a bit by remembering what digits weren't recycled yet and stopping when the list is empty. then golfed a bit more by moving to explicit recursion and a few more tricks.

example output:

*Main> h 110
"110910810710610510410310210100998979695949392919089887868584838281807978776757473727170696867665646362616059585756554535251504948474645443424140393837363534332313029282726252423221"
golfed some more
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading
golfed a byte more ( I didn't add another <s>...</s> because the list is becoming long and it's just one byte)
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading
opps. now fixed
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading
deleted 125 characters in body
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading
golfed a bit
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading
golfed a bit
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading
counted the bytes wrong
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading
added 107 characters in body
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading
Source Link
proud haskeller
  • 6.1k
  • 1
  • 23
  • 37
Loading