# File lib/quiz1/t/solutions/Moses Hohman/deck.rb, line 22 def move_card!(card, offset) current_index = @order.index(card.code) new_index = current_index+offset if new_index >= NUM_CARDS new_index -= NUM_CARDS - 1 elsif new_index < 0 new_index += NUM_CARDS - 1 end @order.delete_at(current_index) @order.insert(new_index, card.code) end