Chapter 4: N2¶
N2 (N standard 2) is SiliconCraft's default high-level language. It provides functions, classes, lists, maps, scoped variables, and libraries for virtual hardware. Compile .n2 files in N2 mode; use main.n2 as a project's entrypoint.
- Language guide: syntax, variables, memory management, functions, classes, collections, and control flow.
- Library reference: console, math, graphics, audio, storage, input, and gamepads.
- Projects and imports: modular source, aliases, entrypoints, and compiler selection.
- DeviceKit peripherals: asynchronous calls, constants, strings, JSON results, and serial discovery.
- Networking: HTTP callbacks and routes, raw mailbox functions, sockets, TLS, WebSocket, and listeners.
- Create and airship peripherals: airship readings and wireless redstone control.
- Examples: standalone programs, an OOP project, peripherals, and networking.