Week 0

Playback Speed

Find the gaps between words and replace each gap.

You type

One line of text.

The tool
Words stay, gaps change One line in Find each gap Same words, new gaps
What comes out

The same words, with the gaps changed.

The question, more slowly

The question is: take one line and print it more slowly, by replacing each space between words. The words themselves do not change. A space is a character, just like a letter, so replacing spaces is a change to the text.

One space becomes the slower gap the spec describes. You are not asked to pause in real time. The slowness is written into the string.

People forget a line that is a single word, which has no space to replace, and should come back unchanged. Also try two spaces in a row and see what the spec wants.

Before you code

Type a sentence with two spaces in a row and notice that a gap is part of the text, not a separate thing.