Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ** MAZE PROGRAM USING FUNCTIONS
- **
- **By Sebastian1314 and Steve Von Fedak
- **
- */
- void turnRight(int timeInt)
- {
- bMotorReflected[port2]= 1;
- motor[port2] = -123;
- motor[port3] = 126;
- wait1Msec(timeInt);
- }
- void turnLeft(int timeInt)
- {
- bMotorReflected[port2]= 1;
- motor[port2] = 123;
- motor[port3] = -126;
- wait1Msec(timeInt);
- }
- void moveStraight(int timeInt)
- {
- bMotorReflected[port2]= 1;
- motor[port2] = 123;
- motor[port3] = 126;
- wait1Msec(timeInt);
- }
- void StopWait(int timeInt)
- {
- motor[port2] = 0;
- motor[port3] = 0;
- wait1Msec(timeInt);
- }
- task main
- {
- bMotorReflected[port2]= 1;
- StopWait(1000);
- moveStraight(1000);
- StopWait(1000);
- turnLeft(360);
- StopWait(1000);
- moveStraight(1150);
- StopWait(1000);
- turnRight(400);
- StopWait(1000);
- moveStraight(620);
- StopWait(1000);
- turnRight(420);
- StopWait(1000);
- moveStraight(500);
- StopWait(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment