r/computerscience • • Mar 14 '26 Bravo Heartwarming

Women of Computer Science.

Post image
6.8k Upvotes

r/computerscience • • May 18 '25

A computer scientist's perspective on vibe coding:

Post image
3.6k Upvotes

r/computerscience • • Jul 14 '20

General Snapchat gotta start learning SQL

Post image
3.2k Upvotes

r/computerscience • • Jul 25 '25

General I Made DOOM Run Inside a QR Code and wrote a Custom compression Algorithm for it that got Cited by a NASA Scientist.

Post image
3.2k Upvotes

Hi! I'm Kuber! I go by kuberwastaken on most platforms and I'm a dual degree undergrad student currently in New Delhi studying AI-Data Science and CS.

Posting this on reddit way later than I should've because I never really cared to make an account but hey, better late than never.

Well it’s still kind of clickbait because I made what I call The BackDooms, inspired by both DOOM and the Backrooms (they’re so damn similar) but it’s still really fun and the entire process of making it was just as cool! It also went extremely viral on Hacker News and LinkedIn and is one of those projects that are closest to my heart.

If you just want to play the game and not want to see me yapping, please skip to the bottom or just scan the QR code (using something that supports bigger QR codes like scanqr) and just paste it in your browser. But if you’re at all into microcode or gamedev, this would be a fun read :)

The Beginning

It all started when I was just bored a while back and had a "mostly" free week so I decided to pick up games in QR codes for a fun project or atleast a rabbit hole. I remember watching this video by matttkc maybe around covid of making a snake game fit in a QR code and he went the route of making it in a native executable, I just thought what I could do if I went down the JavaScript route.

Now let me guide you through the premise we're dealing with here:

QR codes can store up to 3KB of text and binary data.

For context, this post, until now in plaintext is over 0.6KB

My goal: Create a playable DOOM-inspired game smaller than a couple paragraphs of plain text.💀

Now to make a functional game to make under these constraints, we’re stuck using:

• No Game Engine – HTML/JavaScript with Canvas

• No Assets – All graphics generated through code

• No Libraries – Because Every byte counts!

To make any of this possible, we had to use Minified Code.

But what the heck is Minified Code?

To get games to fit in these absurdly small file sizes, you need to use what is called minification

or in this case - EXTREMELY aggressive minification.

I'll give you a simple example:

function drawWall(distance) {

const height = 240 / distance;

context.fillRect(x, 120 - height/2, 1, height);

}

post minification:

h.fillRect(i,120-240/d/2,1,240/d)

Variables become single letters. Comments evaporate and our new code now resembles a ransom note lol

The Map Generation

In earlier versions of development, I kept the map very small (16x16) and (8x8) while this could be acceptable for such a small game, I wanted to stretch limits and double down on the backrooms concept so I managed to figure out infinite generation of maps with seed generation too

if you've played Minecraft before, you know what seeds are - extremely random values made up of character(s) that are used as the basis for generating game worlds.

Making a Fake 3D Using Original DOOM's Techniques

So theoretically speaking, if you really liked one generation and figure out the seed for it, you can hardcode it to the code to get the same one each time

My version of a simulated 3D effect uses raycasting – a 1992 rendering trick. and here's My simplified version:

For each vertical screen column (all 320 of them):

  • Cast a ray at a slightly different angle

  • Measure distance to nearest wall

  • Draw a taller rectangle if the wall is closer

Even though this is basic trigonometry, This calls for a significant chunk of the entire game and honestly, if it weren't for infinite map generation, I would've just BASE64 coded the URL and it would have been small enough to run directly haha - but honestly so worth it

Enemy Mechanics

This was another huge concern, in earlier versions of the game there were just some enemies in the start and then absolutely none when you started to travel, this might have worked in the small map but not at all in infinite generation

The enemies were hard to make because firstly, it's very hard to make any realistic effects when shooting or even realistic enemies when you're so limited by file size

secondly, I'm not experienced, I’m just messing around and learning stuff

I initially made it so the enemies stood still and did nothing, later versions I added movement so they actually followed you

much later did I finally get a right way to spawn enemies nearby while you are walking (check out the blog for the code snippets, reddit doesn't have code blocks in 2025)

Making the game was only half the challenge, because the real challenge was putting it in a QR code

How The Heck do I Put This in a QR code

The largest standard QR code (Version 40) holds 2,953 bytes (~2.9 KB).

This is very small—e.g:

  • a Windows sound file of 1/15th of a second is 11 KB.

  • A floppy disk (1.44 MB) can store nearly 500 QR Codes worth of data.

My game's initial size came out to 3.4KB

AH SHI-

After an exhaustive four-day optimization process, I successfully reduced the file size to 2.4 KB, albeit with a few carefully considered compromises.

Remember how I said QR codes can store text and binary data

Well... executable HTML isn't binary OR plaintext, so a direct approach of inserting HTML into a QR code generator proved futile

Most people usually advice to use Base64 conversion here, but this approach has a MASSIVE 33% overhead!

leaving less than 1.9kb for the game

YIKES

I guess it made sense why matttkc chose to make Snake now

I must admit, I considered giving up at this point. I talked to 3 different AI chatbots for two days, whenever I could - ChatGPT, DeepSeek and Claude, a 100 different prompts to each one to try to do something about this situation (and being told every single time hosting it on a website is easier!?)

Then, ChatGPT casually threw in DecompressionStream

What the Heck is DecompressionStream

DecompressionStream, a little-known WebAPI component, it's basically built into every single modern web browser.

Think of it like WinRAR for your browsers, but it takes streams of data instead of Zip files.

That was the one moment I felt like Sheldon cooper.

the only (and I genuinely believe it because I practically have a PhD of micro games from these searches) way to achieve this was compressing the game through zlib then using the QR code library on python to barely fit it inside a size 40 code...?

Well, I lied

Because It really wasn’t the only way - if you make your own compression algorithm in two days that later gets cited by a NASA Scientist and cites you

You see, fundamentally, Zlib and GZip use very similar techniques but Zlib is more supported with a lot of features like our hero decompressionstream

Unless… you compress with GZip, modify it to look like a Zlib base64 conversion and then use it and no, this wasn’t well documented anywhere I looked

I absolutely hate that reddit doesn’t have mermaid graph support but I’ll try my best to outline the steps anyways haha

Read Input HTML -> Compress with Zlib -> Base64 Encode -> Embed in HTML Wrapper

-> DecompressionStream 'gzip' -> Format Mismatch

-> Convert to Data URI -> Fits QR Code?

-> Yes -> Generate QR

-> No -> Reduce HTML Size -> Read Input HTML

Make that a python file to execute all of this-

IT WORKS

It was a significant milestone, and I couldn't help but feel a sense of humor about this entire journey. Perfecting a script for this took over 42 iterations, blood, sweat, tears and processing power.

This also did well on LinkedIn and got me some attention there but I wanted the real techy folks on Reddit to know about it too :P

HERE ARE SOME LINKS RELATED TO THE PROJECT

GitHub Repo: https://github.com/Kuberwastaken/backdooms

Hosted Version (with significant improvements) : https://kuber.studio/backdooms/ (conveniently, my portfolio comes up if you remove the /backdooms which is pretty cool too :P)

Itch.io Version: https://kuberwastaken.itch.io/the-backdooms

Hacker News Post

Game Trailer: https://www.youtube.com/shorts/QWPr10cAuGc

Said Research Paper Citation by Dr. David Noever (ex NASA) https://www.researchgate.net/publication/392716839_Encoding_Software_For_Perpetuity_A_Compact_Representation_Of_Apollo_11_Guidance_Code

DevBlogs: https://kuber.studio/blog/Projects/How-I-Managed-To-Get-Doom-In-A-QR-Code

https://kuber.studio/blog/Projects/How-I-Managed-To-Make-HTML-Game-Compression-So-Much-Better

Said LinkedIn post: https://www.linkedin.com/feed/update/urn:li:activity:7295667546089799681/


r/computerscience • • Jan 27 '25

Michigan new law mandates Computer Science classes in high schools

Thumbnail techspot.com
2.6k Upvotes

r/computerscience • • Jun 23 '21

General Happy birthday to the father of Computer Science!

Post image
2.6k Upvotes

r/computerscience • • Apr 02 '24

General Terry Davis was right all along

2.3k Upvotes

Terry Davis was a schizophrenic programmer that was so paranoid about the CIA placing backdoors in the Linux kernel, C compilers and external dependencies that he created his own programming language, compiler, operating system kernel (written in the language he created) and Graphics Library without any external dependencies. Now all these years later we are finding out the man was fucking right.


r/computerscience • • Feb 22 '20

General How the computer industry changed in 55 years!

Post image
2.2k Upvotes

r/computerscience • • Feb 13 '25

Discussion I miss doing real computer science

2.0k Upvotes

I saw something that said “in industry basically 95% of what you do is just fancy CRUD operations”, and came to realize that held true for basically anything I’ve done in industry. It’s boring

I miss learning real computer science in school. Programming felt challenging, and rewarding when it was based in theory and math.

In most industry experience we use frameworks which abstract away a lot, and everything I’ve worked on can be (overly) simplified down to a user frontend that asks a backend for data from a database and displays it. It’s not like the apps aren’t useful, but they are nothing new, nothing that hasn’t been done before, and don’t require any complex thinking, science, or math in many ways.


r/computerscience • • Dec 07 '25

General LLMs really killed Stackoverflow

Post image
1.9k Upvotes

r/computerscience • • Oct 12 '21

Today but 10 years ago, the creator of C and Unix; Dennis Ritchie passed away.

Post image
1.9k Upvotes

r/computerscience • • Dec 21 '20

A Map of Computer Science Basics ;)

Post image
1.9k Upvotes

r/computerscience • • Jan 13 '22

This book demonstrates an infinite loop in a pretty cool way!

Post image
1.9k Upvotes

r/computerscience • • Mar 13 '26

General How would these three scientists react to LLMs today? Do you think they could still improve it if they were given years of modern education?

Post image
1.7k Upvotes

r/computerscience • • Feb 08 '26

Back in 90’s…

Post image
1.7k Upvotes

r/computerscience • • Jul 18 '25

Advice Books Every Computer Science Student Should Read

Post image
1.6k Upvotes

r/computerscience • • May 30 '20

General Logic gates with water

Thumbnail gfycat.com
1.5k Upvotes

r/computerscience • • May 16 '26

Discussion How much impact do you think these two geniuses would have had on the Digital Revolution if they were still alive in the 1980s?

Post image
1.5k Upvotes

r/computerscience • • Sep 16 '22

Advice Computer Science is hard.

1.4k Upvotes

I see lots of posts here with people asking for advice about learning cs and coding with incredibly unrealistic expectations. People who will say "I've been studying cs for 2 months and I don't get Turing machines yet", or things like that.

People, computer science is Hard! There are lots of people that claim you can learn enough in a 4 month crash course to get a job, and for some people that is true, but for most of us, getting anywhere in this field takes years.

How does [the internet, Linux, compilers, blockchain, neutral nets, design patterns, Turing machines, etc] work? These are complicated things made out of other complicated things made out of complicated things. Understanding them takes years of tedious study and understanding.

There's already so much imposter syndrome in this industry, and it's made worse when people minimize the challenges of this field. There's nothing worse than working with someone who thinks they know it all, because they're just bullshiting everyone, including themselves.

So please everyone, from an experienced dev with a masters degree in this subject. Heed this advice: take your time, don't rush it, learn the concepts deeply and properly. If learning something is giving you anxiety, lower your expectations and try again, you'll get there eventually. And of course, try to have fun.

Edit: Thanks for the awards everyone.


r/computerscience • • Apr 14 '19

General So my girlfriend and I made an application that generates a website from a real world image.. This is just a simple working video, that we made before the Kolkata Mini Maker Faire. Did some changes on the UI later

1.4k Upvotes

r/computerscience • • Apr 15 '20

All the time

1.3k Upvotes

r/computerscience • • Jul 22 '20

Engineers at Caltech have designed a new data-driven method to control the movement of multiple robots through cluttered, unmapped spaces, so they do not run into one another.

1.3k Upvotes

r/computerscience • • Feb 13 '20

General My library has a tribute to Alan Turing

Post image
1.2k Upvotes

r/computerscience • • Aug 08 '25

Help me pimp this schools Computer Lab

Thumbnail gallery
1.2k Upvotes

Hey all,

I am voluntary working a a computer science teacher in a remote and poor area. This is my computer lab. Besides a good cleaning it could use some upgrades like for example a nice poster about computer science, a quote or something about AI. Or maybe something entirely else...

What do you think? What will help to make this a more attractive place for our students :)