Urgent.News

What's breaking now, across thousands of outlets.

Tech

Can You Reverse-Engineer a Function From Its Inputs and Outputs?

You have a hidden function. You can't see the code. All you can do is give it inputs and inspect the outputs and your job is to figure out what it does. For example: f("hello") → "ohell" f("world") → "dworl" f("codeset") → "tcodese" This one is pretty easy, but now imagine the pattern isn't so obvious. That's the idea behind a little game we built called Mystery Function: 👉…

A hidden function exists, with code concealed from view. The task involves providing inputs and observing the resulting outputs to deduce the function's purpose. For instance: f("hello") yields "ohell", f("world") produces "dworl", and f("codeset") results in "tcodese". Although the pattern may not be immediately apparent, the concept is exemplified by a game called Mystery Function available at https://codeset.ai/function.

Each day, a new hidden function is introduced, and players have the opportunity to test up to 6 inputs. Once a hypothesis is formed, predicting the output for two new inputs becomes necessary to validate the theory. The game encourages developers to shift their focus from writing implementations based on specifications to reverse-engineering behavior to uncover the original specification.

The process evolves into a cycle of testing inputs, analyzing outputs, forming hypotheses, and attempting to disprove them. Upon sharing the game on Hacker News, it unexpectedly gained prominence, captivating many developers who found black-box debugging to be an addictive challenge. The game remains accessible at https://codeset.ai/function, inviting participants to solve the latest function and share the number of tests required to unravel its mystery.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How to Build a Practical Risk Management Process for Software Projects

Software projects rarely fail because everything goes exactly as planned. A dependency changes. A developer becomes unavailable. A security issue appears late in the sprint.

  • Risk management identifies, assesses, and prioritizes uncertainties impacting project goals
  • Formal process improves efficiency as project scales with more tasks and stakeholders
  • Systematic approach assigns owners, monitors risks, and creates response strategies

More from Tuesday 6 October →