[racket] racket library for minecraft pi edition

From: grant centauri (gcentauri at lincolnix.net)
Date: Mon Jun 10 21:01:47 EDT 2013

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:


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130610/751c74b0/attachment-0001.html>

Posted on the users mailing list.