Your solution to the Credit Card Validator challenge is a bit different from the others I’ve seen, and I like it! It’s interesting how you use a .each_with_index iterator to multiply even indexes by two and to add each index to the luhn_sum. That makes your code efficient and DRY.
It’s also great that you incorporate some rspec-like syntax in your driver test code.
Remember that check_card should return true if @total_sum%10== and false if @total_sum%10 !=0.
Hi CJ,
Your solution to the Credit Card Validator challenge is a bit different from the others I’ve seen, and I like it! It’s interesting how you use a .each_with_index iterator to multiply even indexes by two and to add each index to the luhn_sum. That makes your code efficient and DRY.
It’s also great that you incorporate some rspec-like syntax in your driver test code.
Remember that check_card should return true if @total_sum%10== and false if @total_sum%10 !=0.