title: Is there a way to write these ifs nicer?
body: <p>I need to write these four <code>if</code>s in Python. Notice what it does, is changing between four possible states in a loop: <code>1,0 -&gt; 0,1 -&gt; -1,0 -&gt; 0,-1</code> and back to first.</p>
  
  <pre><code>if [dx, dy] == [1,0]:
      dx, dy = 0, 1
  if [dx, dy] == 0, 1:
      dx, dy = -1, 0
  if [dx, dy] == [-1, 0]
      dx, dy = 0, -1
  if [dx, dy] == [0, -1]:
      dx, dy = 1, 0
  </code></pre>
  
  <p>Can anyone suggest me a better/nicer way to write this?</p>