1. Figure out what the program does.
2. Implement logic in the printCountdown method so that every half a second the program displays an object from
the variable list. The output should be in reverse order: from the index passed to Countdown down to zero.
Example: Index 3 is passed
Example console o
Countdown
- 9
Locked
Comments (10)
- Popular
- New
- Old
You must be signed in to leave a comment
aijo
10 February 2022, 19:06
Does anyone understand why countFrom is being decreased first, before the print?
Index 3 is being passed, but the print starts from index 2. Am I the only one confused about this?
0
Felix
8 April 2020, 22:48
I don't see what's wrong with my code:
At validation I get these two errors:
The printCountdown method should reduce (decrement) the value of the variable countFrom.
The printCountdown method must display the list item with an index equal to the new value of countFrom. 0
Angel Li
20 July 2020, 18:04
You don't need the while loop, it's already in the run method.
+2
Switch/Cypher
28 September 2020, 15:03
Yeah sure, that's true. Still though, validator shouldn't fail on those conditions.....
0
Roman Grygorczuk
3 January 2021, 19:02
I believe they want to see your code as simple as possible
0
remote87
4 March 2021, 11:49
Yooohoooo, thank you, Angel!!!
0
Alexandre Lalancette
19 November 2019, 15:24
Don't forget the .join() method ;)
0
Seferi
12 September 2020, 19:48
Why .join() ?
0
Roman Grygorczuk
3 January 2021, 19:00
I didn't get it too...
0
Lex Icon
25 February 2021, 15:47
Join() isn't necessary here.
0