Sandbox
@olistic/warriorjs

JavaScript and TypeScript battle game for the CLI

WarriorJS is a programming game where you write JavaScript or TypeScript to control a warrior through puzzle towers. The code you write decides how the warrior moves, fights, rescues captives, and survives each floor. The project ships a CLI, a website, shared game libraries, and tower content.

9,538 stars499 forksTypeScriptUpdated 5mo ago
Who it's for

People who want to practice coding by solving game levels in the terminal or browser.

What it delivers

You can learn and practice JavaScript or TypeScript by writing code that directly controls game behavior.

What it does

CLI gameplay

Start the game with `warriorjs` and play through guided tower levels from the terminal.

Browser play

Play the game from the website at warriorjs.com without using the CLI.

Tower-based puzzles

Solve levels built around enemies, captives, stairs, and floor-by-floor objectives.

Player API docs

The docs explain the gameplay, towers, and the API you use to write your warrior logic.

Tower authoring

Contributors can build new towers that other players can install and play.

How to get it

  1. 1Install the CLI
    npm install --global @warriorjs/cli
  2. 2Launch the game
    warriorjs

README


Learn JavaScript and TypeScript by writing code that fights


In WarriorJS, you write JavaScript or TypeScript to guide a warrior through towers full of enemies. Each floor is a puzzle: battle sludge, dodge archers, rescue captives, and reach the stairs alive. The code you write is the strategy — there's no clicking, no dragging, just logic and sharp thinking.

Whether you're writing your first if statement or refactoring for a perfect score, every floor will test you.

Quick Start

  1. Install Node.js 22 or later.

  2. Install the CLI:

npm install --global @warriorjs/cli
  1. Launch the game:
warriorjs

The game walks you through creating a warrior and choosing a tower. Open the generated README.md for your first level's instructions, write your solution in Player.js, then run warriorjs again to see how your warrior fares.

You can also play from your browser at warriorjs.com.

Documentation

The official docs cover everything from first steps to building your own towers:

Contributing

The best way to contribute is to build a tower — a set of levels that other players can install and play.

You can also fix bugs, improve the docs, or add new abilities and units. See the contribution guide and Code of Conduct.

Acknowledgments

This project was born as a port of ruby-warrior. Credits for the original idea go to Ryan Bates.

Special thanks to Guillermo Cura for designing a wonderful logo.

License

WarriorJS is licensed under a MIT License.

Files in the repo

Repository payload23 top-level entries
  • .github
  • apps
  • docs
  • libs
  • logo
  • towers
  • .editorconfig
  • .gitattributes
  • .gitignore
  • biome.json
  • CHANGELOG.md
  • CLAUDE.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • lefthook.yml
  • LICENSE
  • package.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml
  • README.md
  • tsconfig.json
  • turbo.json
  • vitest.config.ts

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tutorials & guides

shareAI-lab/
learn-claude-code

Bash is all you need - A nano claude code–like 「agent harness」, built from 0 to 1

77k
luongnv89/
claude-howto
luongnv89/claude-howtoTutorials & Guides

A visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.

41k
agentskills/
agentskills
agentskills/agentskillsTutorials & Guides

Specification and documentation for Agent Skills

25k