How do I get the X coordinate for my turtle graphics turtle

后端 未结 3 1159
悲&欢浪女
悲&欢浪女 2021-01-24 13:17

I can create a turtle that will be in a window with the following code:

Turtle t1 = new Turtle(w,100,100);

If I want to know its coordinates, I

3条回答
  •  离开以前
    2021-01-24 13:37

    I have no idea what Turtle class you are using, but I'd imagine you'd do something like this:

    int x1 = t1.getX(w);
    int x2 = t2.getX(w);
    

提交回复
热议问题