Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRicardo Gonzalez
324 PointsWhat am I Doing wrong?
Thanks for taking your time into answering my questions guys I appreciate.
let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
while numbers < todo.count {println(todo[numbers]) numbers++}
1 Answer
dungeonkeeperhf
3,272 PointsHey Ricardo,
What was the challenge and can you post all of your code along with what error you are getting as It's hard to see where the error is coming from depending on what you want to do.
Thanks, Alex
After looking at the challenge this is the working code:
let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
var timeOfLook = 0
while timeOfLook < numbers.count {
println(numbers[timeOfLook])
timeOfLook++
}
Looks like what you did wrong was having the conditions the wrong way around.
Your should have appended the .count to your numbers variable as it's the array.
Thanks, Alex.
Ricardo Gonzalez
324 PointsI am supposed to do a loop.
dungeonkeeperhf
3,272 PointsI need the rest of your code.
Ricardo Gonzalez
324 PointsYou saying that there is more to this code???
dungeonkeeperhf
3,272 PointsNo, what I was saying is that you hadn't posted all of your code. I had no idea what the variable 'todo' is
Ricardo Gonzalez
324 Pointsoh ok I see
Ricardo Gonzalez
324 PointsRicardo Gonzalez
324 PointsI thought that was the code.