hello, i've been exploring the educational possibilities of connecting a Lisp language to the Minecraft Pi Edition. I started by writing a tutorial using Common Lisp http://www.lincolnix.net/gcentauri/build-tower.html which uses a basic connection API I wrote. This is really my first attempt at a coding project, and I'm scraping together understanding of things from a variety of sources.
the code i have now establishes a socket connection, and i have written a "send-command" function with its own helper functions to prepare the proper string for the Minecraft API. There are only a few functions that receive data, so I decided to have each one handle its reading of the input socket on its own. this is very basic, and i'd actually like to write this in a better way, if possible. i have only included one example function here. i'd like the writing of this library to serve as a tutorial as well, because it has helped me understand a lot about some basic programming tasks. here's the code: https://gist.github.com/anonymous/5745976 my question is mainly about creating a data structure to represent the whole 128x128x128 world, and then sending the "get-block" command to the Minecraft server for every coordinate, and retrieving all of the integers. is this feasable? I have been able to write a function to set a column of blocks recursively (see the build-tower tutorial in CL) which performs very quickly, even when sent from another machine on the network. but the function i wrote (and must have deleted?) to GET a column of block id numbers took a few seconds to complete. i don't know enough about TCP connections and how to send and receive data properly. i'm also unsure of the best way to process this function, as what i'd like to end up with is a "world" data structure containing coordinate/block-id pairs. the idea is that then you could write a function to perhaps turn all the "water" blocks into "air", draining the oceans and rivers. i don't know if this kind of function even makes sense to try with the way the Minecraft API works. I'm unsure about the size of the data, and if it is too big to efficiently operate on in this way. i'm sure i'll have more questions too. but i'm hoping to document the process of learning about this so other learners can benefit from my struggle. thanks, -grant
____________________ Racket Users list: http://lists.racket-lang.org/users