#include "OneDimensionalRobotEasy.cpp" int main(int argc, char **argv) { int i; class OneDimensionalRobotEasy TheClass; int retval; string commands; int A; int B; if (argc != 2) { fprintf(stderr, "usage: a.out num\n"); exit(1); } /* commands = ; A = ; B = ; */ if (atoi(argv[1]) == 0) { commands = "RRLRRLLR"; A = 10; B = 10; } if (atoi(argv[1]) == 1) { commands = "RRRRR"; A = 3; B = 4; } if (atoi(argv[1]) == 2) { commands = "LLLLLLLLLLR"; A = 2; B = 6; } if (atoi(argv[1]) == 3) { commands = "RRRRRRRLRRLRRRRRRRRRRRRLRLRRRRRRRRLRRRRRLRRRRRRRRR"; A = 5; B = 20; } if (atoi(argv[1]) == 4) { commands = "RLRLLLLLLLRLLLRLLLLLLLLRLLLLLRLLLRRLLLLLRLLLLLRLLL"; A = 34; B = 15; } retval = TheClass.finalPosition(commands, A, B); cout << retval << endl; exit(0); }