Saturday, 6 July 2013

Bits of Minecraft

Minecraft has sunk a lot of my time over the few years it's been around. Here are some of the things I've done in it (in order of construction):

A rainbow made of wool is visible to the left, and a large woolen cake lurks in the fog to the right.
Rainbow! ... and cake

A triple helix with hanging vines made of dirt rises into the sky in front of a seemingly floating land.
Triple helix near an overworld plate

From my overworld you can see my home base tower on the left, satellite dish in the centre and the word "Craft" made of wool on the right.
Home, satellite dish and "Craft"
The rainbow, triple helix and satellite dish were all planned using Lisp. Here's some Lisp code you can use to plan rainbows:

(loop with freq = (list)
       and reach = (1+ 20)
       and width = 8
      for j from reach downto 0
    do (loop for i from (- reach) to reach
             for r = (round (sqrt (+ (square i) (square j))))
             for c = (cond ((= i j 0) #\+)
                           ((< r (- reach width)) #\-)
                           ((<= r (1- reach)) (- r (- reach width)))
                           (t #\Space))

        when (not (eql #\Space c))
        do (aif (cdr (assoc c freq))
            (incf (car it))
            (push (list c 1) freq))
        when (or (minusp i) (not (eql #\Space c))) do (princ c))

    do (terpri)
    finally (return freq))

It produces output like this (this one's a small version to fit in the width of the blog):

                 777777777
              777666666666777
            7766655555555566677
          77665554444444445556677
         7665544433333333344455667
        766544433322222223334445667
       76554433222111111122233445567
      7655433221110000000111223345567
     7655433211000-------0001123345567
    766543321100-----------001123345667
    7654332100---------------0012334567
   7654432100-----------------0012344567
   765432110-------------------011234567
  765443210---------------------012344567
  765432100---------------------001234567
  76543210-----------------------01234567
 765433210-----------------------012334567
 76543210-------------------------01234567
 76543210-------------------------01234567
 76543210-------------------------01234567
 76543210------------+------------01234567
((#\+ 1) (#\- 256) (0 45) (1 45) (2 43) (3 57) (4 57) (5 57) (6 59) (7 57))


The last bit is a count of each block type so you know how much to gather of each type. Three dimensional objects like the dish and triple helix use more code which I can post if people are interested.

P.S. Don't spend too much time playing computer games.

2 comments:

  1. That triple helix is amazing! I'd never have the patience to build something like that.

    - FZ @ minecraftservershub.com

    ReplyDelete
  2. To own this good game, you simply access AndroidRub to get it for free, the best Mod Games & Mod Apps store today.

    ReplyDelete