# Count to 20 with Words!

Using the following length-separated lists of words:

https://github.com/Magic Octopus Urn/wordListsByLength

Print 1 word from each list of length n from 1 all the way up to 20, here's a valid example:

a
an
and
hand
hands
handle
handles
abandons
abandoned
understand
outstanding
newfoundland
understanding
characteristic
characteristics
characterization
characterizations
characteristically
characterologically
chemotherapeutically


Alternatively (array):

['a', 'an', 'and', 'hand', 'hands', 'handle', 'handles', 'abandons', 'abandoned', 'understand', 'outstanding', 'newfoundland', 'understanding', 'characteristic', 'characteristics', 'characterization', 'characterizations', 'characteristically', 'characterologically', 'chemotherapeutically']


Alternatively (any printable non-alphabetic separator other than \n):

a:an:and:hand:hands:handle:handles:abandons:abandoned:understand:outstanding:newfoundland:understanding:characteristic:characteristics:characterization:characterizations:characteristically:characterologically:chemotherapeutically


# Rules

• You may choose your own 20 words.
• The words must be from the github page provided, more specifically:
• 1 from 1.txt, 1 from 2.txt, etc...
• Note, files above 20.txt exist, but you do not need any words above 20 characters.
• Valid separators are ASCII-printable non-alphabetical characters (even numbers, don't care).
• Lowercase or uppercase only, pick one, stick with it; no title-case allowed.
• Please don't use a 100% copy of my example 20 words...
• You can, but that's no fun.
• They are likely suboptimal anyways...
• If you DON'T want to use the separated files, and need a full list:
• Use unsorted.txt, this is all n.txt files in one, sorted alphabetically.
• Note, you CANNOT directly read from the URL, it is a common loophole.
• This is , lowest byte-count will be the winner.

For reference, the output is 229 bytes, so anything that gets under that beats hardcoding.

Possible meta-tag-discussion:

where the user gets to customize their outputs from a list of possibilities?

• As someone from Newfoundland, I appreciate the shoutout. :) – scatter Jul 20 '17 at 15:46
• @Christian You could say I... ( •_•)>⌐■-■ understand outstanding newfoundland (⌐■_■) – Magic Octopus Urn Jul 20 '17 at 15:48
• @Riley that's stretching it, 1 delimiter inbetween each word, though I can see many situations where that'd help :P. – Magic Octopus Urn Jul 20 '17 at 16:29
• @JonathanAllan just did :). – Magic Octopus Urn Jul 21 '17 at 0:59
• Utility for choosing the words. – Jim Jul 21 '17 at 10:18

# Jelly,  49 35 31  30 bytes

ṫ3,⁸Ṗ,$€ẎK “¤ƈȮⱮ⁴⁷ọḤƁŒ|⁾Ė»ḲÇ€K  A niladic link returning a list of characters, or a full program printing that list as a string (the words delimited by spaces). Try it online! ### How? ṫ3,⁸Ṗ,$€ẎK - Helper link: list of characters, word    e.g. "abreacts"
ṫ3         - tail word from index 3                          "reacts"
⁸       - chain's left argument, word
,        - pair                               ["reacts","abreacts"]
$€ - last two links as a monad for €ach of the two words: Ṗ - pop (all but last character) "react" / "abreact" , - pair ["react","reacts"] / ["abreact","abreacts"] Ẏ - tighten ["react","reacts","abreact","abreacts"] K - join with spaces "react reacts abreact abreacts" “¤ƈȮⱮ⁴⁷ọḤƁŒ|⁾Ė»ḲÇ€K - Link: no arguments “¤ƈȮⱮ⁴⁷ọḤƁŒ|⁾Ė» - a compressed string using dictionary indexes: - "agar abreacts acknowledges codeterminations deindustrializations" Ḳ - split at spaces Ç€ - call the last link (Helper) as a monad for €ach K - join with spaces  ...which yields: a ar aga agar react reacts abreact abreacts knowledge knowledges acknowledge acknowledges determination determinations codetermination codeterminations industrialization industrializations deindustrialization deindustrializations  Previous: @35: “¡Ụıƭz Xj]"Ɱ*AJƤʂạ5ƬṚṪð^ƥỤ»ḲṖ,$€K€K


Using 10 words and their length-1 prefixes.

@49

“ḊAḥTz¹ỴH¡ṛYẈDƤNŀt#ñ²ĿĊḤlṪnð⁻U+ɦỴĊypṆQ0⁴ṄẉṂi⁻d¤&»


Simply 20 compressed words.

• Darn Jelly dictionary! +1 – Erik the Outgolfer Jul 20 '17 at 17:31
• I didn't know Jelly had a dictionary, to be honest. – Magic Octopus Urn Jul 21 '17 at 0:20
• 30 BYTES!??!!??! I just went to sleep and woke up and it's as low as 30 BYTES?!!??!?!11 O_O_O – Erik the Outgolfer Jul 21 '17 at 8:17
• 30 BYTES!?!?!??! I FORGOT ABOUT THIS CHALLENGE FOR A MONTH AND HE WON WITH 30 BYTES!?!?! – Magic Octopus Urn Aug 17 '17 at 21:43

# Python 2, 145 bytes

print'i am now tiny @ @s##s#ed#act#acts#@#@s#@ed#@ing#arguments#accusation#accusations#advertisings'.replace('#',' counter').replace('@','check')


Try it online!

Prints these words, separated by spaces:

i
am
now
tiny
check
checks
counter
counters
countered
counteract
counteracts
countercheck
counterchecks
counterchecked
counterchecking
counterarguments
counteraccusation
counteraccusations

• "i am now tiny" - I like the self-descriptive code... – trichoplax Jul 20 '17 at 18:43

# PowerShell, 166 163 bytes

'a
an
and'
'','s','le','ler','lers'|%{"hand$_"} ($a="character")
($x=-split"s ed ful ized istic istics ization izations istically ologically"|%{"$a$_"}) "un"+$x[8]


Try it online!

Hand-optimized, no algorithms. The two loops |%{ } tack on the appropriate ending to the appropriate beginning. I'm searching for a way to get them down into one loop.

• Wow, my example looks even dumber now xD! characterful > newfoundland – Magic Octopus Urn Jul 20 '17 at 15:42

# Python, 169 bytes

z='odahs princesses acclimatizers cyanocobalamines aerothermodynamics underrepresentations'.split()
print([y[:i+1]for x,y in zip(['']+z,z)for i in range(len(x),len(y))])


Prints a list of the words.

Try it online!

Words gained by scanning sequences of matching words, by start or end of the word and starting from length 1 upwards or from length 20 downwords.

Here is the script I used to get it. (the upward-start-matching one)

• 171 bytes (it feels like it should be shorter, but it isn't): Try it online! – Stephen Jul 20 '17 at 17:19

# Python 2,  126 120  112 bytes

-8 bytes thanks to Anders Kaseorg (I thought I'd migrated this from Python 3, but turns out I'd forgotten!)

A port of my Jelly answer works well in Python too...

for w in"agar abreacts acknowledges codeterminations deindustrializations".split():print w[2:-1],w[2:],w[:-1],w,


Try it online!

Prints:

a ar aga agar react reacts abreact abreacts knowledge knowledges acknowledge acknowledges determination determinations codetermination codeterminations industrialization industrializations deindustrialization deindustrializations

• Python 2 lets you end with print w[2:-1],w[2:],w[:-1],w, for −8 bytes. – Anders Kaseorg Jul 28 '17 at 23:03
• Oh, oops I forgot about this or thought I'd done it - I have a TIO page open somewhere with that! – Jonathan Allan Jul 28 '17 at 23:05
• Thanks for that though! – Jonathan Allan Jul 28 '17 at 23:09

# JavaScript, 159 bytes

_='a1an1and}}swwrwrs~~s~ed~ful~ized{{s~|~|s{ally~ologically1misx|s~1x}1hand|ization{~isticxcharacterw}le';for(i of'wx{|}~')with(_.split(i))_=join(pop());f=f=>_


Try it online!

Thanks @HyperNeutrino for edit. But, I am reverting back to old post (removing "Node.js" flag) because it has nothing to do with Node.js. It perfectly works in browsers too.

• f=f=>_ threw me off, I was like "won't that override the function" (it would just prevent recursion) – Stephen Jul 20 '17 at 16:07
• @StepHen. I'm not sure if leaving a plain string is allowed. As I understood, the code should represent a function (or whole program), thats why I added it to the end. Variable _ already contains the string. – user72349 Jul 20 '17 at 16:09
• You're correct, I was just really confused as to what it did, since you reused the variable name (f as both function name and (ignored) parameter name) – Stephen Jul 20 '17 at 16:15

# 05AB1E, 51 bytes

’¯Óa‚‡’D“€…€¤Þ¨íÊƒé¢Ã¥£žÜ¶ß´ç…àçî×Ü»‡Ûà³ŒçÓs²® ÿ ÿs


Try it online!

Separator: 

List of words: a, an, ana, anal, house, houses, amazing, criminal, seriously, apparently, accessories, disciplinary, distributions, discrimination, congratulations, responsibilities, characterizations, telecommunications, representationalist, representationalists

• want to participate in own challenge intensifies – Magic Octopus Urn Jul 21 '17 at 0:19
• I'm guessing 05AB1E has no 20-length words in the dictionary :P? Have yet to actually check myself. – Magic Octopus Urn Jul 21 '17 at 0:29
• @MagicOctopusUrn Nope. – Adnan Jul 21 '17 at 1:06
• @adnan wow, that approach... may actually be a good idea if you can find a way to generate all dictionary code-points in like 1-10 bytes... – Magic Octopus Urn Jul 21 '17 at 1:12
• @adnan that was my first attempt, I'm sure you could knock it outta the park. – Magic Octopus Urn Jul 21 '17 at 1:48

# Ruby, 120 bytes

j=3
$><<?a " 5 T & } < ".bytes{|i|puts 8.times{|k|$><<%w{dehydro chlori ge n at ion e s}[k]*(j>>7-k&1)}
j+=i-31}


Prints the following. Each word is built from the 8 strings above, using the binary digits of j to select. On each iteration of the loop, j is incremented by the ASCII value of the characters in the string in quotes, minus 31.

a
es
ion
ions
nates
nation
nations
chlorine
chlorines
chlorinate
chlorinates
chlorination
dehydrogenate
dehydrogenates
dehydrogenation
dehydrogenations
dehydrochlorinate
dehydrochlorinates
dehydrochlorination
dehydrochlorinations


# Pyth, 74 bytes

.e:"psychopathologicallyadventuresomenesses"b+bhkiR36"GGGGBKMMKKM6K6M0K0K0


Try it online! It outputs:

['a', 'al', 'all', 'ally', 'logic', 'advent', 'venture', 'ventures', 'adventure', 'adventures', 'venturesome', 'pathological', 'adventuresome', 'pathologically', 'venturesomeness', 'psychopathologic', 'adventuresomeness', 'psychopathological', 'adventuresomenesses', 'psychopathologically']


Which, once formatted yields:

a
al
all
ally
logic
venture
ventures
venturesome
pathological
pathologically
venturesomeness
psychopathologic
psychopathological
psychopathologically


Explanation

The key was to choose two words that complement each other. I chose "psychopathologically" and "adventuresomenesses" thanks to a little tool I wrote. Using these two words, for any length we can find substrings which are actual words of the provided list. All the possible decompositions are demonstrated by:

a al all ally logic psycho logical          logically pathologic             pathological               pathologically                 psychopathologic                   psychopathological                     psychopathologically


The next step is just to get the list of the indexes for a given decomposition. For my decomposition, I chose: 16 16 16 16 11 20 22 22 20 20 22 6 20 6 22 0 20 0 20 0, which are indexes in the concatenated strings: psychopathologicallyadventuresomenesses.

Finally, write a program which just loops over the indexes and display the substring at each given index with increasing length.

For saving bytes, I stored the indexes in a base 36 string. Indeed, GGGGBKMMKKM6K6M0K0K0 is the list of my indexes in base 36 (because my highest index is 22, I could have used base 23).

Program explanation

.e:"psychopathologicallyadventuresomenesses"b+bhkiR36"GGGGBKMMKKM6K6M0K0K0

iR36"GGGGBKMMKKM6K6M0K0K0    # For each character in the string, convert from base 36 to base 10
.e                                                                            # Loop over indexes: b are the indexes, h their position
:"psychopathologicallyadventuresomenesses"b+bhk                             # In "psy...ses", select the substring at index b and of length k + 1

• psychopathologically - "In terms of the scientific study of mental disorders." Interesting. – Magic Octopus Urn Jul 25 '17 at 19:17

# C#, 259 bytes

_=>{var a=new int[7].Select((n,i)=>"abasers".Substring(0,i+1)).ToList();a.Add("abacuses");a.AddRange(new int[12].Select((n,i)=>(i>10?"un":"")+"character"+"|s|ed|ful|ised|istic|istics|isation|isations|istically|ologically|istically|".Split('|')[i]));return a;}


Some obvious room for golfing still but I've run out of time now. I know it's longer than hard coding so will fix it when I get some time later on.

• Woops is actually even longer because I need to include using System.Linq; – TheLethalCoder Jul 20 '17 at 16:02
• Just returning them in a string split by spaces is like 245. – Magic Octopus Urn Jul 20 '17 at 16:29
• @MagicOctopusUrn I know that's what I said in my answer... – TheLethalCoder Jul 20 '17 at 19:20

# 05AB1E, 130 68 bytes

-62 bytes thanks to Erik the Outgolfer

743222’€Ü†š ƒ´aî³eros €‡a•¿f²Ñns …¿en®íizers ‚ÀÙŠs ‡åØŽ’#‚øεηRs£R}˜


Try it online!

Takes as many prefixes as needed from each of the following words:

amusers
carabinero
foraminiferans
photosensitizers
videoconferencings


Prints these words in an array:

a
am
amu
amus
amuse
amuser
amusers
carabine
carabiner
carabinero
carabineros
foraminifera
foraminiferan
foraminiferans
photosensitizer
photosensitizers
videoconferencing
videoconferencings


# Bubblegum, 66 bytes

00000000: 6d8b 410a 0020 0804 bf6a 4407 a134 5aff  m.A.. ...jD..4Z.
00000010: 4fe6 29ac 93ce b0a3 543a ad06 3f6c e769  O.).....T:..?l.i
00000020: 46f3 3ae2 b218 abc4 2cab d389 a805 82aa  F.:.....,.......
00000030: fee1 6e43 2444 62df 0f46 4a1e f356 8cf1  ..nC\$Db..FJ..V..
00000040: 73d8                                     s.


Output:

oalresalitresetpresetpresentrationalrepresentrationalesannotationsconnotationsconnotationalrepresentationrepresentationsrepresentationalmisrepresentationmisrepresentationsrepresentationalismrepresentationalisms


Try it online!

The words and separator were selected by simulated annealing:

from __future__ import print_function
import math
import random
import zlib

wordlists = \
[[chr(x).encode() for x in [9, 10] + list(range(32, 127)) if not chr(x).encode().isalpha()]] + \
[open('wordListsByLength/{}.txt'.format(n), 'rb').read().splitlines() for n in range(1, 21)]

words = [random.choice(wordlist) for wordlist in wordlists]

temperature = 10.
score = 9999
best = score

while True:
old_score = score
n = random.randrange(len(wordlists))
old_word = words[n]
words[n] = random.choice(wordlists[n])
z = zlib.compressobj(9, zlib.DEFLATED, -zlib.MAX_WBITS, 9)
score = len(z.compress(words[0].join(words[1:])) + z.flush())
if score > old_score and random.random() >= math.exp((old_score - score) / temperature):
words[n] = old_word
score = old_score
else:
temperature *= .99999
if score < best:
best = score
print(best, repr(words[0].join(words[1:])))


# Bubblegum, 78 bytes

00000000: 654b c301 4431 10bd a7cb d876 9a5f efe7  eK..D1.....v._..
00000010: 781e 2080 ee55 0488 ffc8 9f69 e86f a5ff  x. ..U.....i.o..
00000020: ce00 0b98 202e 34ed d701 a464 bf59 35fb  .... .4....d.Y5.
00000030: 23d7 9192 b948 7c79 f351 0c8b f4ee 06e4  #....H|y.Q......
00000040: 8b05 1a33 77c8 1bcf 7f58 7577 e113       ...3w....Xuw..


Try it online!

# Ruby, 107 bytes

p(z=%w{o or for form ultra})+[z[3],c="centrifug",z[4]+c].product(%w{ed ing ally ation ations}).map{|i|i*""}


Prints the following array.

["o", "or", "for", "form", "ultra", "formed", "forming", "formally", "formation", "formations", "centrifuged", "centrifuging", "centrifugally", "centrifugation", "centrifugations", "ultracentrifuged", "ultracentrifuging", "ultracentrifugally", "ultracentrifugation", "ultracentrifugations"


Changing the p for puts (with trailing space) gives the following at a cost of an additional 4 bytes.

o
or
for
form
ultra
formed
forming
formally
formation
formations
centrifuged
centrifuging
centrifugally
centrifugation
centrifugations
ultracentrifuged
ultracentrifuging
ultracentrifugally
ultracentrifugation
ultracentrifugations


# Japt, 119 bytes

av„v„dvjvjsvj¤vj¤svfœejvqvqsvq‚vqˆgvqizƒvqÄKcvqÄKcsvqizÂ\nvqizÂ\nsvq‰tkvqologkv·sqizÂ\nsd'jÊ@'kÅœ§'qÖ‹a× q'v ·


Try it online!

## Prints:

a
an
and
hand
hands
handle
handles
freehand
character
characters
charactered
charactering
characterizes
characteristic
characteristics
characterization
characterizations
characteristically
characterologically
mischaracterizations