What parts of the programming are you having problems with? Reading the state of a switch is trivial. Incrementing or decrementing a variable based on the state of the pins is trivial. Using a switch/case statement to handle what to do depending on the variable value is easy.