What CC:Tweaked Is, and Why It's Worth It
CC:Tweaked (the community continuation of ComputerCraft) adds real programmable computers: desktops with terminals, 'Turtles' that mine, place, and move, and pocket computers you carry. They run Lua — a genuinely widely used real-world language (game scripting, embedded). Unlike 'edu' modes, this is the authentic programming environment: syntax, loops, and event models transfer directly, while the outputs (auto-miners, sorters) are real in-game value. For a first step into coding inside a game, there is no smoother entry.
Lua in Fifteen Minutes
Type 'edit hello' on a computer, write print("hello world"), save, run — that's the start. Five core things: ① variables and printing: x = 10, print(x); ② loops: for i = 1, 10 do ... end; ③ conditionals: if x > 5 then ... end; ④ functions: function digLine(n) ... end; ⑤ the turtle API: turtle.dig(), turtle.forward(), turtle.place() are ready-made functions. The first practical program is usually a tunnel digger: a for loop alternating turtle.dig() and turtle.forward(), under ten lines. Errors print line numbers straight to the terminal — don't fear them.
Two Practical Projects
Project one, 'warehouse sorting': pipes behind chests plus a computer polling peripherals — peripheral.wrap("bottom") grabs the container below, reads inventory, and signals redstone/pipes to sort. Project two, the 'lumber turtle': check growth, chop, step forward, repeat — paired with a tree farm it's a perpetual timber line. Advanced directions: redstone events (os.pullEvent("redstone")) and rednet messaging — networks of dozens of turtles coordinated by a central computer are everyday community sights. When you stall, the Pastebin API lets you download community programs directly.
Comments
Powered by GitHub Discussions — sign in with GitHub to comment.