Programming Challenges

I thought my design was elegant, but I'm afraid I must confess this
feels difficult (and not even fun-difficult) to debug. I feel like I
would be done a long time ago if this were Python and I was allowed to
just mutate things instead of juggling these swap! circumlocutions. Am
I wrong? Is it me? Am I just not good enough?