+ (addition operator), 20
= (assignment operator), 23
{...} (command line argument array), 138, 150
-- (comment), 38
/ (division operator), 20
" (double quote), 31
^ (exponentiation operator), 20
> (greater than operator), 52-53
>= (greater than or equal to operator), 52–53
<= (less than or equal to operator), 52–53
--[[ ]] (multiline comment), 38
* (multiplication operator), 20
~= (not equal to operator), 52–53
' (single quote), 31
.. (string concatenation operator), 31–32
- (subtraction operator), 20
acacia tree, 89
addition operator (+), 20
algorithms, 61
announce program, 159
application programming interface (API), 76
appstore program, 44
assignment operator (=), 23
assignment statement, 23
downloading, 2
installing Minecraft with, 3
attack() function, 216
attackDown() function, 216
attackUp() function, 216
bedrock, 193
birch tree, 89
blaze rod, 15
blocks, of code, 40
block IDs. See name IDs
bonus activities
cake factory, 123
cobble together more cobblestone furnaces, 110
dance move module, 83
different-colored checkerboards, 171
giant wheat fields, 186
going down, 70
lone turtle farmer, 96
maze runner, 44
mylabel program with command line arguments, 141
new dance moves, 42
plus-shaped rooms, 151
proper introductions, 33
tall tunnel, 207
turtle by any other name, 34
watchturtle, 58
Boolean operators
bots, 9
break statement, 94
buildFloor() function, 165, 210
buildfloor program, 166
buildRoom() function, 147–149, 210
buildroom program, 149
buildWall() function, 134–137, 145, 151, 210
calling functions, 19
case sensitive, 25
CC. See ComputerCraft (CC)
charcoal, 15
chickens, 188
chunks, loading, 90
cobblestone, 100
cobblestone generator, 100–102, 118
command line argument array ({...}), 138, 150
command line arguments, 13, 43, 138
commands
delete, 43
/gamemode, 7
history, 14
ls, 30
comment (--), 38
compareDown() function, 69, 215
compareTo() function, 214
ComputerCraft (CC), xviii
API website, 209
wiki, xxi
conditions, 50
constants, 104
countInventory() function, 130, 210
craft() function, 116, 121, 216
crafting
bone meal, 88
cakes, 123
coal blocks, 167
computers, 11
quartz blocks, 167
turtles, 11
current slot (inventory), 60
dance program, 13
dark oak tree, 89
data types, 31
nil, 50
string, 31
table, 80
delete command, 43
delete() function, 210
detect() function, 64, 104, 215
detectDown() function, 64, 215
diamond
axe, 60
hoe, 179
shovel, 60
dig() function, 62, 68–69, 216
digDown() function, 69, 182, 202, 216
digUntilClear() function, 197–198, 202, 210
digUpUntilClear() function, 197–198, 207, 210
division operator (/), 20
double quote ("), 31
drop() function, 95, 122, 183, 214
Edit program, 28
eggs, gathering, 188
elseif statement, 54
empty string, 31
equipLeft() function, 60, 115, 214
equipRight() function, 60, 115, 214
Movement obstructed, 39
Out of fuel, 39
Unbreakable block detected, 202
error() function, 68, 93, 106, 119, 140, 184, 216
evaluating, expressions, 20
exponentiation operator (^), 20
fences, 174
fields, 154
find() function, 212
findBlock() function, 176, 180, 210
floor() function, 107–108, 211
flow control statements, 40
for loop statement, 40–41, 82–83
forward() function, 37–39, 215
fs.delete() function, 210
fuel slot, 105
functions, 19. See also names of individual functions
function statement, 72
return statement, 74
fuel slot, 105
input slot, 105
output slot, 105
/gamemode command, 7
getComputerLabel() function, 32, 211
getFuelLevel() function, 25–26, 106, 184, 205, 212
getFuelLimit() function, 25–26, 213
getItemCount() function, 79, 108–109, 120, 130, 214
getItemDetail() function, 77, 80, 81, 214
getItemSpace() function, 214
getSelectedSlot() function, 214
givecandy program, 74
graphical user interface (GUI), 12–13
greater than operator (>), 52–53
greater than or equal to operator (>=), 52–53
growth mindset, xx
hardcore mode, 7
hare.buildFloor() function, 165, 210
hare.buildRoom() function, 147–149, 210
hare.buildWall() function, 134–137, 145, 151, 210
hare.countInventory() function, 130, 210
hare.digUntilClear() function, 197–198, 202, 210
hare.digUpUntilClear() function, 197–198, 207, 210
hare.findBlock() function, 176, 180, 210
hare program, 75, 128–130, 145–146, 160–161, 176, 197–198
hare.selectAndPlaceDown() function, 130–131, 155, 156, 210
hare.selectEmptySlot() function, 78, 211
hare.selectItem() function, 76, 78–79, 170, 186, 211
hare.sweepField() function, 161–163, 185, 211
hello program, 28
input slot, 105
inspect() function, 92–93, 176–177, 215, 218
inspectDown() function, 181–182, 216
inspectUp() function, 216
interpreter, Lua, xviii–xix, 30
inventory
current slot, 60
of player, 12
of turtle, 12
stack, 13
irrigation of crops, 174
iteration, 40
.jar files, 4
jungle tree, 89
lava, 100
lava bucket, 15
less than or equal to operator (<=), 52–53
loops
for loop statement, 40–41, 82–83
while loop statement, 50
ls command, 30
Lua, xviii
lua> prompt, 17
math.ceil() function, 107–108, 211
math.floor() function, 107–108, 211
math.random() function, 22, 211
maze, 44
Minecraft
buying, 2
creating a new world, 6
sales, xvii
Minecraft Forge mod, 3
mods, xviii
use on a server, 3
vanilla Minecraft, xviii
modpacks, 3
Movement obstructed error, 39
multiline comment (--[[ ]]), 38
multiplication operator (*), 20
'minecraft:cactus', 190
'minecraft:carrot', 186
'minecraft:chest', 176, 180, 183
'minecraft:coal_block', 170
'minecraft:cobblestone', 106
'minecraft:dye', 93
'minecraft:log', 76–77, 79, 81, 95
'minecraft:potato', 186
'minecraft:quartz_block', 170
'minecraft:reeds', 190
'minecraft:sapling', 89, 91, 93
'minecraft:wheat_seeds', 182, 186
Nether quartz, 167
nil data type, 50
not equal to operator (~=), 52–53
oak tree, 89
operators, 20
order of operations, 21
os.getComputerLabel() function, 32, 211
os.loadAPI() function, 76, 211
os.setComputerLabel() function, 33–34, 211
os.sleep() function, 96, 105, 110, 122, 186, 211
Out of fuel error, 39
output slot, 105
overwriting variables, 24
parameters, 73
password, 2
pastebin program, 43
get 1aZ8BhNX buildwall, 138, 150
get 1zS07K3U brickcrafter, 119
get 8NgPXXxN choptree, 64
get BLCJbpQJ mydance, 43
get Epr9CndN buildfloor, 166
get iXRkjNsG appstore, 44
get PGH1WYpH stairminer, 200
get QAH0uYqS mydance2, 49
get QQQK3mqk buildcheckerboard, 168
get SfcB8b55 farmwheat, 179
get sML2CbZ3 announce, 159
get U0WVM4wg buildroom, 150
get v5h8AgGs farmtrees, 89
get wwzvaKuW hare, 76, 103, 130, 146, 150, 161, 176, 198, 210
get YhvSiw7e cobminer, 103
place() function, 91–92, 212, 216
placeDown() function, 92, 183, 212
planting
programs. See also names of individual programs
programming language, 17
redstone, 11
Render Distance option, Minecraft, 90
return statement, 74
rom folder, 30
room-building algorithm, 144–145
sayhello program, 73
scope
select() function, 79, 116, 122, 214
selectAndPlaceDown() function, 130–131, 155, 156, 210
selectEmptySlot() function, 78, 211
selectItem() function, 76, 78–79, 170, 186, 211
setComputerLabel() function, 33–34, 211
shell
shell.run() function, 70, 94, 212
single quote ('), 31
sleep() function, 96, 105, 110, 122, 186, 211
slots (inventory), 13, 78. See also current slot
source code, 28
spruce tree, 89
stack (inventory), 13
stair-mining algorithm, 193–197
step number, 41
sticks, 14
strings
concatenation operator (..), 31–32
data type, 31
empty, 31
string.find() function, 212
string.sub() function, 212
subtraction operator (-), 20
suckDown() function, 120, 188, 215
survival mode, 6–7, 11, 127, 173
sweepField() function, 161–163, 185, 211
text editor, 5
textutils.slowPrint() function, 33, 212
then keyword, 52
tonumber() function, 139, 180, 201
tools
wooden, 14
transferTo() function, 121, 215
tree-chopping algorithm, 61–62
tree-farming algorithm, 86
tree types, 89
turtle.attack() function, 216
turtle.attackDown() function, 216
turtle.attackUp() function, 216
turtle.back() function, 37–39, 215
turtle.compare() function, 69, 215
turtle.compareDown() function, 69, 215
turtle.compareTo() function, 214
turtle.compareUp() function, 69, 215
turtle.craft() function, 116, 121, 216
turtle.detect() function, 64, 104, 215
turtle.detectDown() function, 64, 215
turtle.detectUp() function, 64, 215
turtle.dig() function, 62, 68–69, 216
turtle.digDown() function, 69, 182, 202, 216
turtle.digUp() function, 62, 69, 216
turtle.down() function, 39, 42, 215
turtle.drop() function, 95, 122, 183, 214
turtle.dropDown() function, 95, 214
turtle.dropUp() function, 95, 214
turtle.equipLeft() function, 60, 115, 214
turtle.equipRight() function, 60, 115, 214
turtle.forward() function, 37–39, 215
turtle.getFuelLevel() function, 25–26, 106, 184, 205, 212
turtle.getFuelLimit() function, 25–26, 213
turtle.getItemCount() function, 79, 108–109, 120, 130, 214
turtle.getItemDetail() function, 77, 80, 81, 214
turtle.getItemSpace() function, 214
turtle.getSelectedSlot() function, 214
turtle.inspect() function, 92–93, 176–177, 215, 218
turtle.inspectDown() function, 181–182, 216
turtle.inspectUp() function, 216
turtle.place() function, 91–92, 212, 216
turtle.placeDown() function, 92, 183, 212
turtle.placeUp() function, 92, 212
turtle.refuel() function, 205, 214
turtle.select() function, 79, 116, 122, 214
turtle.suck() function, 120, 214
turtle.suckDown() function, 120, 188, 215
turtle.suckUp() function, 120, 215
turtle.transferTo() function, 121, 215
turtle.turnLeft() function, 18–19, 38, 215
turtle.turnRight() function, 19, 38, 215
turtle.up() function, 39, 42, 215
Unbreakable block detected error, 202
usage messages, 139–140, 150, 166, 180, 201
values, 20
vanilla Minecraft, xviii
variables, 23
constant, 104
names, 25
overwriting of, 24
wall-building algorithm, 131–134
water bucket, 174
wheat-farming algorithm, 175–176
wheat seeds, planting, 182–183
while loop statement, 50
wiki, ComputerCraft, xxi
wood, 14
wooden tools, 14