2 Replies
      Latest reply: Sep 30, 2016 2:33 AM by eskimo RSS
      gethynb Level 1 Level 1 (0 points)

        Hi Guys,

         

        Can any one help me understand why this code:

         

        for counter in stride(from: 10, to:0, by: -1){   

        print(counter) 

        }

         

        counts 10,9,8...1 not 10,9,8...0

         

        Somehow changing it to

         

        for counter in stride(from: 10, to:-1, by: -1){

            print(counter)  

        }

         

        does not feel right.

         

        Regards Gethyn