Intermediate Projects
Prerequisites: Level 2 — Intermediate
Build these using closures, metatables, OOP, modules, error handling, files, and coroutines from Level 2.
1. Inventory System
Write an Item class and an Inventory class (with metatables) that adds,
removes, and searches items, saves them to a file, and loads them back.
Package it as a module.
2. Vector Math Library
Build a 2D Vector type with __add, __sub, __mul, __eq,
__tostring, and __len, plus methods for length, normalization, and dot
product. Use it to simulate a bouncing ball.
3. Log Analyzer
Read a log file line by line, parse each line with string patterns into a table (time, level, message), and print counts per level and the most frequent error messages.
4. Task Scheduler
Use coroutines to run several "tasks" that each do a step of work and yield, with a scheduler that runs them in turn — including tasks that wait a number of ticks before continuing.