Minecraft ComputerCraft Wiki
Advertisement
Apis

The APIs as viewed in a Computer's terminal

View this page on the Official ComputerCraft Wiki: http://computercraft.info/wiki/index.php?title=Category:APIs

An API (Application Programming Interface) is a fairly large block of code inserted or called into a program to ease on the coder. An example is a game development API that adds in features that make game development easier.

Currently there are 20 default APIs that come with ComputerCraft: bit, colors, colours (same as colors), coroutine, disk, fs, help, http, io, math, os, parallel, rednet, redstone, rs (shortened redstone), shell, string, table, term, and textutils. Users can also use their own APIs.

Users can view all the currently enabled APIs by entering 'api' in their terminal.

APIs can be used in one of 3 ways. They can be inserted directly into the code, called in through means of running it at the same time as the other code or it can be run all the time by the BIOS. So far however, there are no APIs that run straight from the BIOS, that's just a theory.

APIs tend to be ~200 lines of code. Some APIs may be used as databases or memory storage for people. Some may be serial encoders/decoders, and some may be to assist in other forms of coding.

Advertisement