HeadlinesBriefing favicon HeadlinesBriefing.com

Emacs Lisp SimCity Clone: A Functional Approach

Hacker News: Front Page •
×

A developer has created an Emacs Lisp-based clone of SimCity, dubbed ElCity. The project, built over a week, aims to explore the "functional core / imperative shell" architecture. It incorporates a Domain Specific Language (DSL) for defining tiles and effects, facilitating testing and extension. The game is turn-based and features an ASCII-based user interface optimized for terminal sessions.

ElCity's architecture emphasizes a clear separation between state and effects, making it easier to debug and scale. The game's core simulation is pure and deterministic. Players can build and manage a city within Emacs, placing residential, commercial, and industrial zones alongside roads and power plants. The project emphasizes a functional approach to software development.

Gameplay is turn-based, with funds increasing each turn based on population and zone levels. Controls allow players to place zones, roads, and power plants. The project is a great example of using Emacs to create a simple game. The developer is welcoming feedback and contributions to improve the simulation aspects of the game.

This project's significance lies in its demonstration of functional programming principles within the constraints of Emacs Lisp. It provides a practical example of the "functional core/imperative shell" approach. While the gameplay is currently simplistic, the codebase offers a valuable resource for those interested in functional programming and game development within Emacs.