import turtle

# Set up the screen and turtle
screen = turtle.Screen()
screen.title("Car Movement on a 10x10 Grid")
screen.setup(width=600, height=600)
screen.setworldcoordinates(-1, -1, 10, 10)

car = turtle.Turtle()
car.shape("triangle")  # Set the turtle shape to a triangle (like a car)
car.color("blue")  # Set the color of the car

# Function to move the car forward
def moveForward():
    car.forward(1)

# Function to turn the car right
def turnRight():
    car.right(90)

# Function to turn the car left
def turnLeft():
    car.left(90)

# Define key bindings for movements
screen.onkeypress(moveForward, "Up")
screen.onkeypress(turnRight, "Right")
screen.onkeypress(turnLeft, "Left")

screen.listen()
turtle.done()
