๐Ÿงญ Helm

Countdown to Warp

Stardate 55124.0 ยท UES Magnanimous

Briefing

The Captain enjoys the countdown before a warp jump. It is, he says, "the one bit of theatre we are still allowed". Ensign Tannenbaum's new countdown routine announces the starting number over and over and then says "engage", which the Captain has described as "less theatre, more a man shouting a number".

The routine should count down from the starting number to one, each followed by three dots and a space, and finish with the word engage. From zero, it should simply say engage. The Captain has been extremely clear about the dots.

Mission objectives

ARCHIE checks all five every time you run diagnostics.

  • โ€ขFrom five: '5... 4... 3... 2... 1... engage'
  • โ€ขFrom one: '1... engage'
  • โ€ขFrom zero: just 'engage'
  • โ€ขFrom three
  • โ€ขFrom ten, and the double digits do not break the spacing
Ask Commander Raghunathan for a hint

Loop from n down to 1, collecting each number followed by '... ', then add 'engage'. Building a list of parts and joining them is tidier than concatenating in the loop, and it makes the zero case fall out for free.