Turtle Command

xcor

Returns the x-coordinate of the turtle.

Examples:

if xcor = 2 [setc red] commands the turtle to set its color to red of its x-coordinate is equal to 2.

Related commands:
ycor xcor-at xcor-of xcor-towards