Quiz+5-8

Quiz 5-8:

Write a program that would make your Robot traverse a square using NO functions. Note: each leg of the square is assumed to take 2 seconds at 50% power. Good Luck!

task main { motor[motorB]=50; S1 motor[motorC]=50; wait1Msec(2000);

motor[motorB]=0; T1 motor[motorC]=50; wait1Msec(400);

motor[motorB]=50; S2 motor[motorC]=50; wait1Msec(2000);

motor[motorB]=0; T2 motor[motorC]=50; wait1Msec(400

<span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;"> motor[motorB]=50; S3 <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">motor[motorC]=50; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">wait1Msec(2000);

<span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">motor[motorB]=0; T3 <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">motor[motorC]=50; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">wait1Msec(400);

<span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">motor[motorB]=50; S4 <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">motor[motorC]=50; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">wait1Msec(2000);

<span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">motor[motorB]=0; T4 <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">motor[motorC]=50; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">wait1Msec(400); <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">}