NASA Countdown

The NASA wants to shoot yet another rocket to the orbit. As this is your first day as a wannabe scientist at the ground control, you are very excited. So excited that when the guy responsible for the countdown asks you to bring him some coffee, you accidentally spill it all over his lap and the computer – both are not capable of doing their job now.

But the liftoff is only seconds away. Somebody has to do the countdown – or the rocket can’t start and millions of dollars are lost! In a moment of great bravery you remember you learnt how to count (a long time ago in High School). So you take the chance!

The ground control chief will tell you where to start – then count to 0.
(example for ’11’: 11 10 9 8 7 6 5 4 3 2 1 0)

Coding Kata

<html>
<body>
<script type="text/javascript">
	function countdown(start){
		for (i=start; i>=0; i++){
			document.write("T-MINUS " + i + "<br />");
		}
	}
	
	countdown(20);
</script>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>