Basically, I am trying to solve a problem a textbook. The book requires me to use karel J robot to develop programming principles. So the problem is correctly the following code so that the robot will do this: attached
This is the code I am suppose to fix. Currently the robot moves in a straight direction and doesn't turn. I do not know why. Please give me some hints, any help could be appreciated.
import cs1Lib.karel.Robot;
import cs1Lib.karel.World;
public class PlantSquare extends Object
{
public static void main(String[] args)
{ World world = new World();
Robot karel = new Robot(12);
world.addRobot(karel, 1, 1, World.EAST);
int side = 0;
while (side < 4)
{
int step = 0;
while (step < 3)
{
karel.move();
karel.putBeeper();
}
karel.turnLeft();
}
karel.turnOff();
}
}