Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Do users need absolute coordinates? (The Java API provides a turtle.) #16

Open
jonathanfine opened this issue Sep 29, 2014 · 7 comments
Labels

Comments

@jonathanfine
Copy link
Contributor

So far as I know, the users of Logo don't see absolute coordinates when programming the turtle.

According to wikipedia

The turtle moves with commands that are relative to its own position,
such as "move forward 10 spaces" and "turn left 90 degrees".

The turtle has a position and an orientation. Minecraft allows the programmer to get the player's position.

I've just found in the Java api for Minecraft a file turtle.java, with methods such as left, right, up and down.

@jvlomax
Copy link
Contributor

jvlomax commented Sep 29, 2014

As long as we can get a users rotation we can use relative coordinates

@dbrgn
Copy link
Member

dbrgn commented Sep 29, 2014

As far as I know, we can not get the rotation. I might be wrong on that though :)

I'd provide a turtle library, but as an addon. I think a lot of people are happy with absolute coordinates.

@jonathanfine
Copy link
Contributor Author

Well, it would be nice to provide absolute and relative (or turtle if you wish) coordinates. It would be good if the API was designed so that it could support both, without being clumsy for either.

By the way, absolute coordinates are turtle coordinates, for a suitable choice of the turtle (provided it does not move).

@bennuttall
Copy link
Member

Basic Turtle style functions would be nice, i.e. forward, back, left right. A similar action to penDown would be easily done too. Similar to my "if it's not grass, place grass" example in the usage guide but I wouldn't bother calling it penDown for the sake of compatibility.

@bennuttall
Copy link
Member

Also I'd say those functions should do the call to getPos themselves, so you can just go forward 10.

Likewise, it should be easy to get the block you're standing on (currently x, y-1, z) - I thought this was what getTilePos did but that seems to be some sort of rounding thing.

@jvlomax
Copy link
Contributor

jvlomax commented Sep 30, 2014

The problem with designating something as forward is that you don't know if "forward" is x+1 or z+1 unless you know the current rotation

@bennuttall
Copy link
Member

Good point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants