SuppliedOrange / obcb-contraptions

A list of fun projects I made on OBCB
Other
1 stars 0 forks source link

obcb-contraptions

A list of all the fun stuff I made on One Billion Checkboxes (OBCB)

Prerequisites

You need to do npm install in the directory.

The startIndex, referenced in many files is the index of the pixel you are referring to.

A formula to calculate the pixel would look something like:

const pixelsPerRow = 60;
const pixelsPerPage = 262144;
function getPixelInPage(row = 0, column = 0, page = 0) {
    const pixelWithinPage = (row * pixelsPerRow) + column;
    const pageStart = pixelsPerPage * page;
    const pixelIndex = pageStart + pixelWithinPage;
    return pixelIndex;
}

I think this should work, I think. I just hacked the javascript to show me the pixel indices of all checkboxes so I don't have to deal with this.

Contents

Generating an image on a page one time

an image being rendered on checkboxes

Generating a slideshow of images

a series of images being rendered one after another on checkboxes

Generating a digital clock

a digital clock rendered on checkboxes

This is obviously a sped-up version but you get the idea.

Generating an infinite game of pong

a digital clock rendered on checkboxes

Generating working game of tic-tac-toe

a digital clock rendered on checkboxes

Running retro game emulators

Inside the retrobot directory is a modified fork of the retrobot emulator discord bot.

1: How to run your own retro game

We've played actual games on the emulator!

a digital clock rendered on checkboxes

a digital clock rendered on checkboxes

2: Run tetris, it works great

a digital clock rendered on checkboxes

3: Make tetris play by itself

This does not actually play tetris by itself, but the original NES Tetris comes with a built-in auto-play screensaver, which plays games of tetris seemingly on it's own (even though it's likely pre-recorded).

Rendering images on the grand scale

Like the original OMCB, this repository has code to render and draw on a 32768 x 32768 pixel square.

Rendering the square

a digital clock rendered on checkboxes

Drawing on the large scale

Here comes the tricky part, I never actually solved this myself. I came up with a hacky fix and I'm still disappointed in the way that it works. I wouldn't consider this a reliable method but I no longer have the patience to fix this.

1: Dither an image

a digital clock rendered on checkboxes

2: Draw the image

This is a weird thing that was introduced because I might've messed up my math, but GPT couldn't find the problem either so I gave up.

1) For a 1k x 1k image, the multiplier can be left at 1. 2) For a 5k x 5k image, the multiplier must go to 6 (or 6.5 also works). 3) For a 5k x 2.7k image, the multiplier can be 4 (or 4.5 is better). 4) For a 5k x 6.3k image, the multiplier must go to 7 or 7.5.

a digital clock rendered on checkboxes

Motive

There was a popular website called One Million Checkboxes (OMCB). It was wow-ed at for it's ability to handle the state of a million checkboxes in real-time.

Later, the creator made this video, where he mentioned that a group of teenagers made art out of checkboxes. I missed it, and I probably never would've found it, but I found One Billion Checkboxes, it was made by someone in the same server that orchestrated the OMCB artists' operations.

Then, I immediately got to work to recreate what I would've had I laid my hands on OMCB. Out of excitement, I wrote this rushed gist about how I found this super cool alternative site.

And then, in a matter of a week or two, here I am, sharing the cool stuff I made on OBCB. I'm especially glad for the friends I made while making these silly projects, alongside the trolls I met that sabotaged me. It was short, but it was nice.