npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ohnrshyp/brick-drohp

v1.0.1

Published

Terminal Brick Drohp built with Ohnrscript

Readme

BrickDrohp.Ohn

A playable Brick Drohp written in Ohnrscript — the same i32-only, no-GC, no-floats, no-dynamic-heap language used to build ohn-kernel.

The engine lives in one file: brick-drohp.ohn. A small HTML/canvas shim reads engine state and paints it — the same shape of split the V-language Doom port has with SDL.

Play it:

Open playground.built.html directly in a browser or node play.js for terminal. No server, no dependencies, no build step — one file, ~18KB, drop it anywhere. It also runs from file://, so you can double-click it.

Controls:

P pause   R restart   / move   soft drop   rotate clockwise   Z rotate counter-clockwise   Space hard drop

</td>
<td valign="top" width="43%">
   <h2>Architecture in one paragraph</h2>
  <p>
    <code>brick-drohp.ohn</code> is one file with 37 functions, no <code>require()</code>, no arrays literals, no <code>switch</code>, no closures, no floats. The board is a 200-byte <code>Uint8Array</code> (10×20, one byte per cell).
  </p>
  <br>
  <p>
    The 7 tetrominoes × 4 rotations are 28 entries in a module-level <code>Int32Array</code>, each a 16-bit mask over a 4×4 box. The RNG is a hand-rolled xorshift32 driving a Fisher-Yates 7-bag. Gravity is an integer frame counter. All arithmetic is <code>| 0</code>-cast.
  </p>
  <br>
  <p>
    The compiled <code>brick-drohp.js</code> is a 1:1 translation of the source — the V8 backend injects no runtime. The browser shim is deliberately logic-free: it reads state via query functions (<code>getCell</code>, <code>getScore</code>, <code>getActivePieceType</code>, ...) and issues movement calls (<code>moveLeft</code>, <code>rotateCW</code>, <code>hardDrop</code>, ...). Game logic lives entirely in <code>brick-drohp.ohn</code>.
  </p>
</td>

Building from source

Rebuilding brick-drohp.js and playground.built.html requires the Ohnrscript compiler, which lives in the main Ohnrscript repo. Assuming a clone at ../ohnrscript alongside this one:

# Compile the engine to JS node ../ohnrscript/compiler/scripts/compile.js brick-drohp.ohn -o brick-drohp.js

# Run the tests against the compiled output npx jest

# Rebuild the standalone browser file node build.js

What's in this repo

| File | What it is | | :---- | :---- | | brick-drohp.ohn | The engine. 37 functions. Board, tetromino shapes (all 4 rotations), collision, movement, rotation, gravity, 7-bag randomizer (xorshift32), line-clear, scoring, leveling. Written in the strict Ohnrscript subset defined in developer_guide.md. | | brick-drohp.js | Compiled output of brick-drohp.ohn via the V8 backend. Generated, not hand-written — committed here because rebuilding requires the separate Ohnrscript compiler repo. | | playground.html | The browser shim template — <canvas> rendering, keydown handlers, requestAnimationFrame loop calling tick(). | | playground.built.html | The hostable artifact. build.js inlines the compiled engine into playground.html to produce this single self-contained file. | | build.js | Node script that inlines the compiled engine into the shim template. | | play.js | Terminal frontend for the same engine — a second, logic-free shim reading state from brick-drohp.js and painting the board with ANSI 256-color escapes. Run with node play.js. Requires a TTY. | | tests/brick-drohp.test.js | 16 jest tests running against the compiled JS — shape integrity across all rotations, wall collisions, gravity and locking, line-clear math (including the 1200-point Brick Drohp bonus), leveling, 7-bag correctness, game-over handling. |