The system reads a .txt file consisting of the possible paths that it can take. The possible paths are stored with 3 bits.
First bit 1 - Moving left is possible
Second bit 1 - Moving forward is possible
Third bit 1 - Moving right is possible.
If there are multiple possible paths, the car will prioritise going front first, followed by right then left.
Once the program runs, for each step taken, there will be 2 different kinds of output. Firstly, the direction moved would be printed as “Move Forward”, “Turn Right”, and “Turn Left”. Secondly, at each coordinate, there would be information about the coordinate and the car printed.
Each coordinate stores the following information:
X and Y values.
pathAvail: A 3-bit value which reads the .txt file and determines the possible paths relative to where the car is facing.
pathUnexplored: Similar to pathAvail, but once the possible path is taken, the bit is removed.
nextOrientation: A 2-bit value storing the orientation of the car after its next move, relative to where the car was previously.
selfOrientation: A 2-bit value storing the car’s current orientation.
isLast: A 1-bit value which indicates whether the coordinate is the last visited one.
The car is also able to detect loops and a dead end/explored point. If the car reaches a dead end/explored point, it will turn around by turning right twice. If the car reaches a loop, it will ##TBD