Problem 1115. USC Fall 2012 ACM: Driving the Rover

Solution 176202

Submitted on 12 Dec 2012 by @bmtran (Bryant Tran)
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% tic urlwrite('',''); toc

Elapsed time is 0.626805 seconds.

2   Pass
%% fid=fopen('','r'); xy_expect=[3 2;2 29;107 23;-79 -72]; qty=fscanf(fid,'%i',1); for q=1:qty %qty n = fscanf(fid,'%f\n',1); % commands m=cell(n,1); for i=1:n m{i}=fgetl(fid); end [xy]=Drive(m) ; assert(isequal(xy,xy_expect(q,:))) % fprintf('Q %i x %i y %i Pass %i\n',q,xy,tf) end % q fclose(fid); toc

Elapsed time is 1.165864 seconds.