How would you like it improved?
Programming help
Started by random987654321, Dec 20 2012 04:50 PM
23 replies to this topic
#21
Posted 21 December 2012 - 01:55 AM
#22
Posted 21 December 2012 - 02:09 AM
Mabey have it compacted?
#23
Posted 21 December 2012 - 02:17 AM
function mine() for i = 1,2 do turtle.digDown() turtle.down() end turtle.dig() turtle.select(3) turtle.place() turtle.select(2) for i = 1,2 do turtle.up() turtle.placeDown() end turtle.select(1) turtle.place() end
It doesn't really shorten the code, but makes it abit more eyepleasing to read.
#24
Posted 21 December 2012 - 07:05 AM
Hmm...I'd have thought you'd want the overall program to lay more than two mines. Also, using a sand/gravel (gravel makes stone pressure plates harder to spot, if this is intended for PVP) rather than dirt causes the mine to drop the entity which triggers the mine into a pit, which can be made deeper. But this involves reducing the damage to other entities which may be about (though having the tnt under a layer of dirt also does that).
Using nested for loops would let you easily lay a larger minefield, if that's desired.
Using nested for loops would let you easily lay a larger minefield, if that's desired.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











