Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char* argv[])
- {
- Finch myFinch;
- while(myFinch.wasTapped()!= '1')
- {
- if(myFinch.wasShaken())
- {
- if(myFinch.isBeakDown() == '1')
- {
- fila.meterFila(0);
- }
- else if(myFinch.isBeakUp() == '1')
- {
- fila.meterFila(1);
- }
- else if(myFinch.isRightWingDown())
- {
- fila.meterFila(2);
- }
- else
- {
- fila.meterFila(3);
- }
- }
- while(!fila.filaVacia)
- {
- switch(fila.observaFila())
- {
- case '0':
- myFinch.setMotors(-200,-200);
- break;
- case '1':
- myFinch.setMotors(200,200);
- break;
- case '2':
- myFinch.setMotors(150, 250);
- break;
- case '3':
- myFinch.setMotors(250, 150);
- break;
- default:
- break;
- }
- fila.sacarFila();
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment