There is a helicopter flying 500 meters from the ground. It can fly up 100 meters, which takes 1.0 secs. Or if it doesn't fly up it will fall 200 meters, which also takes 1.0 secs - This means if the instruction is anything other than "Fly" the helicopter falls. Build a program that takes input of a list of instructions, telling the helicopter when to fly and when not to. When the helicopter falls it should output the time counter.
Fly Dance Fly Golf Fly Fly
1) Fly == Fly so +100 = 600m
2) Dance != Fly so -200 = 400m
3) Fly == Fly so +100 = 500m
4) Golf != Fly so -200m = 300m
5) Fly == Fly so +100 = 400m
6) Fly == Fly so +100 = 500m
7) NO INSTRUCTIONS so -200 = 300m
8) NO INSTRUCTIONS so -200 = 100m
9) NO INSTRUCTIONS so -100 = 0m (This takes 0.5 seconds)
Each instruction should be separated by a space, and if the instuction isn't fly, then automatically fall. When the program runs out of instructions automatically fall. Your program must output in (float)secs, and if it takes => 60.0 seconds display in mins and seconds eg. 1 mins 32.0 secs
Seconds are float decimal values, minutes are whole interger values. Also note capitalization does not matter your program should work for capitals or no capitals.
This is code-golf so the least NO bytes wins!