INDEX

SYMBOLS

+ (addition operator), 20

= (assignment operator), 23

{...} (command line argument array), 138, 150

-- (comment), 38

/ (division operator), 20

" (double quote), 31

== (equal to operator), 5253

^ (exponentiation operator), 20

> (greater than operator), 52-53

>= (greater than or equal to operator), 5253

< (less than operator), 5253

<= (less than or equal to operator), 5253

% (modulus operator), 163164

--[[ ]] (multiline comment), 38

* (multiplication operator), 20

~= (not equal to operator), 5253

> (prompt), 13, 17

' (single quote), 31

.. (string concatenation operator), 3132

- (subtraction operator), 20

A

acacia tree, 89

addition operator (+), 20

algorithms, 61

and operator, 6566

announce program, 159

application programming interface (API), 76

appstore program, 44

arguments, 22, 73

Artemisia, 13, 73

assignment operator (=), 23

assignment statement, 23

ATLauncher, xix, 5

downloading, 2

installing Minecraft with, 3

attack() function, 216

attackDown() function, 216

attackUp() function, 216

B

back() function, 3739, 215

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 data type, 4950, 53

Boolean operators

and operator, 6566

not operator, 6465

or operator, 6667

bots, 9

break statement, 94

brickcrafter program, 116117

buildFloor() function, 165, 210

buildfloor program, 166

buildRoom() function, 147149, 210

buildroom program, 149

buildWall() function, 134137, 145, 151, 210

buildwall program, 137138

C

cactus, farming, 189190

calling functions, 19

carrots, planting, 186187

case sensitive, 25

CC. See ComputerCraft (CC)

ceil() function, 107108, 211

charcoal, 15

checkerboard, 168169

chests, 11, 118

chickens, 188

choptree program, 6263

chunks, loading, 90

coal blocks, 15, 167, 171

cobblestone, 100

cobblestone generator, 100102, 118

cobminer program, 102103

command line argument array ({...}), 138, 150

command line arguments, 13, 43, 138

commands

delete, 43

/gamemode, 7

history, 14

ls, 30

shell, 12, 13

comment (--), 38

compare() function, 69, 215

compareDown() function, 69, 215

compareTo() function, 214

compareUp() function, 69, 215

comparison operators, 5253

ComputerCraft (CC), xviii

API website, 209

installing, 45

wiki, xxi

concatenation, 3132

conditions, 50

constants, 104

countInventory() function, 130, 210

cows, milking, 187188

craft() function, 116, 121, 216

crafting

bone meal, 88

cakes, 123

coal blocks, 167

computers, 11

mining turtles, 1012

quartz blocks, 167

stone bricks, 121122

turtles, 11

creative mode, 67, 11

current slot (inventory), 60

D

dance program, 13

dark oak tree, 89

data types, 31

Boolean, 4950, 53

nil, 50

string, 31

table, 80

delete command, 43

delete() function, 210

detect() function, 64, 104, 215

detectDown() function, 64, 215

detectUp() function, 64, 215

diamond

axe, 60

hoe, 179

pickaxe, 12, 60

shovel, 60

tools, 12, 60

dig() function, 62, 6869, 216

digDown() function, 69, 182, 202, 216

digUntilClear() function, 197198, 202, 210

digUp() function, 62, 69, 216

digUpUntilClear() function, 197198, 207, 210

division operator (/), 20

do keyword, 40, 50

double quote ("), 31

down() function, 39, 42, 215

drop() function, 95, 122, 183, 214

dropDown() function, 95, 214

dropUp() function, 95, 214

E

Edit program, 28

eggs, gathering, 188

Elisabetta, 13, 34, 73

else statement, 54, 5556

elseif statement, 54

empty string, 31

end keyword, 40, 50

equal to operator (==), 5253

equipLeft() function, 60, 115, 214

equipRight() function, 60, 115, 214

errors, 21, 29

Movement obstructed, 39

Out of fuel, 39

Unbreakable block detected, 202

error() function, 68, 93, 106, 119, 140, 184, 216

evaluating, expressions, 20

execution, 30, 40

exists() function, 91, 210

exit() function, 19, 216

exponentiation operator (^), 20

expressions, 2021

F

false value, 18, 50, 51

farmtrees program, 8788

farmwheat program, 177179

fences, 174

fields, 154

find() function, 212

findBlock() function, 176, 180, 210

floor() function, 107108, 211

flow control statements, 40

for loop statement, 4041, 8283

forward() function, 3739, 215

fs.delete() function, 210

fs.exists() function, 91, 210

fuel, 1416, 39

fuel slot, 105

functions, 19. See also names of individual functions

function statement, 72

passing functions to, 158160

return statement, 74

return value, 18, 74

furnace, 101102

fuel slot, 105

input slot, 105

output slot, 105

G

/gamemode command, 7

getComputerLabel() function, 32, 211

getFuelLevel() function, 2526, 106, 184, 205, 212

getFuelLimit() function, 2526, 213

getItemCount() function, 79, 108109, 120, 130, 214

getItemDetail() function, 77, 80, 81, 214

getItemSpace() function, 214

getSelectedSlot() function, 214

givecandy program, 74

glass, 11, 100, 118

global scope, 8182

go program, 13, 1617

graphical user interface (GUI), 1213

gravel, 197, 202

greater than operator (>), 5253

greater than or equal to operator (>=), 5253

growth mindset, xx

H

hardcoding, 62, 153

hardcore mode, 7

hare.buildFloor() function, 165, 210

hare.buildRoom() function, 147149, 210

hare.buildWall() function, 134137, 145, 151, 210

hare.countInventory() function, 130, 210

hare.digUntilClear() function, 197198, 202, 210

hare.digUpUntilClear() function, 197198, 207, 210

hare.findBlock() function, 176, 180, 210

hare program, 75, 128130, 145146, 160161, 176, 197198

hare.selectAndPlaceDown() function, 130131, 155, 156, 210

hare.selectEmptySlot() function, 78, 211

hare.selectItem() function, 76, 7879, 170, 186, 211

hare.sweepField() function, 161163, 185, 211

hello program, 28

help, xxxxi

I

if statement, 5152

indents, 41, 55

infinite loops, 51, 57, 119

input slot, 105

inspect() function, 9293, 176177, 215, 218

inspectDown() function, 181182, 216

inspectUp() function, 216

interpreter, Lua, xviiixix, 30

inventory

current slot, 60

of player, 12

of turtle, 12

slots, 13, 78

stack, 13

io.read() function, 33, 211

iron, 11, 100

irrigation of crops, 174

iteration, 40

J

.jar files, 4

jungle tree, 89

L

label program, 13, 32

lava, 100

lava bucket, 15

Lavinia, 13, 74

less than operator (<), 5253

less than or equal to operator (<=), 5253

loadAPI() function, 76, 211

local scope, 8182

Logo, 910

loops

for loop statement, 4041, 8283

infinite, 51, 57, 119

while loop statement, 50

ls command, 30

Lua, xviii

interpreter, xviiixix, 30

shell, 1719

lua program, 13, 1719

lua> prompt, 17

M

math.ceil() function, 107108, 211

math.floor() function, 107108, 211

math.random() function, 22, 211

maze, 44

'metadata' key, 181182

Minecraft

buying, 2

creating a new world, 6

modes, 67

running, 57

sales, xvii

Minecraft Forge mod, 3

mods, xviii

use on a server, 3

vanilla Minecraft, xviii

modpacks, 3

modules, 19, 75

modulus operator (%), 163164

Movement obstructed error, 39

multiplayer server, 3, 5

multiline comment (--[[ ]]), 38

multiplication operator (*), 20

mydance program, 3637

mydance2 program, 4748

mylabel program, 34, 141

N

name IDs, 77, 217226

'minecraft:cactus', 190

'minecraft:carrot', 186

'minecraft:chest', 176, 180, 183

'minecraft:coal_block', 170

'minecraft:cobblestone', 106

'minecraft:dye', 93

'minecraft:log', 7677, 79, 81, 95

'minecraft:potato', 186

'minecraft:quartz_block', 170

'minecraft:reeds', 190

'minecraft:sapling', 89, 91, 93

'minecraft:wheat', 181, 183

'minecraft:wheat_seeds', 182, 186

nesting, 5455, 135

Nether quartz, 167

nil data type, 50

not equal to operator (~=), 5253

not operator, 6465

O

oak tree, 89

obsidian, xvii, 100

operators, 20

Boolean, 6467

comparison, 5253

math, 2021

order of operations, 21

or operator, 6667

os.getComputerLabel() function, 32, 211

os.loadAPI() function, 76, 211

os.setComputerLabel() function, 3334, 211

os.sleep() function, 96, 105, 110, 122, 186, 211

Out of fuel error, 39

output slot, 105

overwriting variables, 24

P

parameters, 73

passing arguments, 23, 73

password, 2

pastebin, 4243

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

pickaxe, 10, 12, 13, 14, 60

place() function, 9192, 212, 216

placeDown() function, 92, 183, 212

placeUp() function, 92, 212

planks, 14, 15, 218219

planting

carrots, 186187

potatoes, 186187

saplings, 86, 9192

vegetables, 186187

wheat seeds, 182183

print() function, 3031, 216

programs. See also names of individual programs

running, 2930

saving, 2829

stopping, 13, 16, 50, 180

programming language, 17

prompt (>), 13, 17

public server, 3, 5

Q

quartz blocks, 167, 171

R

random() function, 22, 211

read() function, 33, 211

redstone, 11

refuel() function, 205, 214

refuel program, 13, 1516

Render Distance option, Minecraft, 90

return statement, 74

return value, 18, 74

rom folder, 30

room-building algorithm, 144145

running programs, 2930

S

sand blocks, 189, 197, 202

saplings, planting, 86, 9192

saving programs, 2829

sayhello program, 73

scope

global, 8182

local, 8182

select() function, 79, 116, 122, 214

selectAndPlaceDown() function, 130131, 155, 156, 210

selectEmptySlot() function, 78, 211

selectItem() function, 76, 7879, 170, 186, 211

setComputerLabel() function, 3334, 211

sheep, shearing, 187188

shell

command, 12, 13

Lua, 1719

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

slowPrint() function, 33, 212

Sofonisba, 13, 29, 32

source code, 28

spruce tree, 89

stack (inventory), 13

stairminer program, 199200

stair-mining algorithm, 193197

step number, 41

sticks, 14

stone bricks, 121122

strings

concatenation operator (..), 3132

data type, 31

empty, 31

string.find() function, 212

string.sub() function, 212

subtraction operator (-), 20

suck() function, 120, 214

suckDown() function, 120, 188, 215

suckUp() function, 120, 215

sugar cane, farming, 189190

survival mode, 67, 11, 127, 173

sweeping algorithm, 154158

sweepField() function, 161163, 185, 211

sweepFunc parameter, 154155

T

table data type, 80, 93

text editor, 5

running programs in, 2930

saving programs in, 2829

textutils.slowPrint() function, 33, 212

then keyword, 52

toggling, 136, 163, 170

tonumber() function, 139, 180, 201

tools

diamond, 12, 60

wooden, 14

transferTo() function, 121, 215

tree-chopping algorithm, 6162

tree-farming algorithm, 86

tree types, 89

true value, 18, 50, 51

turtleappstore.com, 44

turtle.attack() function, 216

turtle.attackDown() function, 216

turtle.attackUp() function, 216

turtle.back() function, 3739, 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, 6869, 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, 3739, 215

turtle.getFuelLevel() function, 2526, 106, 184, 205, 212

turtle.getFuelLimit() function, 2526, 213

turtle.getItemCount() function, 79, 108109, 120, 130, 214

turtle.getItemDetail() function, 77, 80, 81, 214

turtle.getItemSpace() function, 214

turtle.getSelectedSlot() function, 214

turtle.inspect() function, 9293, 176177, 215, 218

turtle.inspectDown() function, 181182, 216

turtle.inspectUp() function, 216

turtle.place() function, 9192, 212, 216

turtle.placeDown() function, 92, 183, 212

turtle.placeUp() function, 92, 212

turtle.refuel() function, 205, 214

turtles, xviii, 9

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, 1819, 38, 215

turtle.turnRight() function, 19, 38, 215

turtle.up() function, 39, 42, 215

tutorials, xxxxi

typewriter effect, 33, 212

U

Unbreakable block detected error, 202

up() function, 39, 42, 215

usage messages, 139140, 150, 166, 180, 201

V

values, 20

false, 18, 50, 51

return, 18, 74

true, 18, 50, 51

vanilla Minecraft, xviii

variables, 23

constant, 104

names, 25

overwriting of, 24

vegetables, planting, 186187

W

wall-building algorithm, 131134

water, 100, 174

water bucket, 174

watermelon, 127128

wheat, 174175

wheat-farming algorithm, 175176

wheat seeds, planting, 182183

while loop statement, 50

wiki, ComputerCraft, xxi

wood, 14

wood planks, 14, 15, 218219

wooden tools, 14

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset