/*Competition Code for 6.270 for Team #11 */ void main() { long timeout = 1000l; long start_time_ms; int xpos, ypos, ourwinner; startup(); /*Runs all the startup stuff: servos, ir etc */ teamnumber = determine_teamnumber(); tone(440.0, .1); ourwinner = -ourcolor; /*0 =red, 1 =green, 0 = white 1 = black */ retract_pusher(); closeballgate(); /*push the first four to the wall*/ forward(60, 300.); /*spit them out */ push_balls(); /*pick up the bottom-side top two */ navigateTo(0, (teamsign*222)); /*pick up the bottom-side bottom two */ navigateTo((teamsign*160), (teamsign*222)); /*pick up the left-side bottom two */ navigateTo((teamsign*0), (teamsign*222)); navigateTo((teamsign*0), (teamsign*280)); navigateTo((teamsign*221), (teamsign*280)); /*pick up the left-side right two */ navigateTo((teamsign*221), (teamsign*85)); navigateTo((teamsign*221), (teamsign*280)); /*get to the center of the voting area */ navigateTo((teamsign*235), (teamsign*280)); navigateTo((teamsign*235), (0)); /*if we're losing, vote */ if(!(rf_vote_winner == ourwinner)) { turnangle(90.0); printf("Preparing to Vote\n"); forward(80, 50.); backup(80, 20.); printf("Voting\n"); push_balls(); turnabs(180.); } /*pick up the left-side four and slam into the white goal*/ navigateTo((-teamsign*255), (-teamsign*300)); /*pick up the top-side left two*/ /*pick up the top-side right two*/ /*go to the wall and turn to face our top-right scoring area */ /*push through their scoring area and into ours*/ navigateTo(teamsign*(235),-teamsign*(325)); navigateTo(teamsign*(235),-teamsign*(222)); navigateTo(teamsign*(150),-teamsign*(222)); navigateTo(teamsign*(221),-teamsign*(222)); navigateTo(teamsign*(221),-teamsign*(280)); navigateTo(teamsign*(150),-teamsign*(280)); navigateTo(teamsign*(150),-teamsign*(330)); navigateTo(-teamsign*(230),-teamsign*(330)); navigateTo(-teamsign*(230),teamsign*(330)); /*hope we didn't lose to an inanimate cube*/ printf("Did I win?"); upscale(); downscale(); upscale(); downscale(); }