Powershell, 1614 bytes
Sum array elements. An operator + can work as a unary and binary operator.
+(1,0,2)[$i++%3][$i++] Test script:
+(1,0,2)[$i++%3][$i++] $i=0 # or start new powershell session +(1,0,2)[$i++%3]+[$i++]+(1,0,2)[$i++%3][$i++] $i=0 # or start new powershell session +(1,0,2)[$i++%3]+[$i++]+(1,0,2)[$i++%3]+[$i++]+(1,0,2)[$i++%3][$i++] Note: $i=0 emulates a new session. You can type three times in a new powershell terminal window to start a pure test instead.
Output:
1 1 3