Day 10 of Flatiron School
I got a lot done this morning. Especially after the coffee kicked in. When I started I was definitely not 100% awake. I even did some extra credit on a lab which I typically do not do. I’ve never been the type to want to score 105 on a test because I aced it AND the extra credit. I did this one specifically because I knew it wouldn’t take much time as I was writing a generic method for a specific method I had just completed. Basically inserting place holders where the original problem had specific items.
So first I solved this:
Advanced: Try building a method swap_elements_from_to
that takes in three arguments, array, index, destination_index
, that will allow you to specify the index of the element you would like to move to a new index.
Like this:
Then I did this:
Advanced #2: Try writing test coverage for it! Like this:
And it worked!
I successfully wrote my first test! I was stoked! I know that I’ll have to write my own tests in the future so this small win was nice.
As I kept on working, I must say, the fact that I got this as an error is awesome:
I can definitely see why test driven development (TDD) makes so much sense. I had been thinking it was almost like doing double the work but I could’ve been stuck there forever because of one letter.
Time spent today: 2:39
Time spent total: 41:07
Lessons completed today: 9
Lessons completed total: 218
If you know someone that is thinking about doing an online coding bootcamp, please share this article on Facebook and Twitter.
And please click the 💚 below so that other people will see this here on Medium. Thank you for reading.
This originally appeared on my blog here.