• s&
  • newsNews
  • family_star About
  • forum Forum
  • code_blocks Documentation
  • quick_reference_all Api
  • log in
  • language
    简体中文
    English
    Русский
    Español
    Português-Brasil
    Deutsch
    日本語
    Français
    Polski
    Türkçe
    한국어
    Pirate
    Italiano
    ไทย
    繁體中文
    Українська
    Čeština
    Nederlands
    Magyar
    Dansk
    Suomi
    Svenska
    Norsk
    Ελληνικά
    Română
    Български
    Tiếng Việt
    Bahasa Indonesia
    Español-Latinoamérica
    العربية
    हिन्दी
Brainflock
from Har0x
thumb_up_alt
14
thumb_down_alt
1
favorite
5
library_books
0

Information

homeAbout
newspaperNews
reviewsReview
bug_reportBug Report
tips_and_updatesFeature Request

Diagnostics

home_storageRevisions
brightness_alertReport Abuse

Recent News

Infinite Loop Fix93
Brainfuck Puzzle Game182
s&box
Har0x
Brainflock
News
Brainfuck Puzzle Game

Brainfuck Puzzle Game

calendar_today 1/18/2025 people Har0x chat_bubble 0 visibility 182

The Inspiration

By 
Har0x
The initial spark for choosing Brainfuck came from the language’s intriguing name. As I explored its syntax and functionality, I became fascinated by its simplicity and unique constraints, making it a perfect fit for a puzzle-based game. While I briefly considered other esoteric languages like Deadfish, Brainfuck stood out as the best choice for this project.

Building the Game

By 
Har0x
Iterative Development

Development began with creating a working Brainfuck interpreter. Once I was confident in its functionality, I built a simple 2D UI to display information and accept input. The UI includes:
  • A password displayed on-screen.
  • An ASCII table showing character values for the password and output.
  • A text box for entering Brainfuck code (via keyboard or on-screen buttons).
  • A memory cell display to track values during execution.
As the project progressed, I let feature creep happen naturally. For example, I added an ASCII helper that displays ASCII values beneath characters to simplify translations without referring to the table.
1

Introducing Difficulties

By 
Har0x
Initially, passwords were generated with a fixed length of 8 characters. I realized this was too challenging and implemented difficulties:
  • Easy: 3 characters.
  • Medium: 6 characters.
  • Hard: 9 characters.
This change lets players choose a level suited to their familiarity and provides a manageable learning curve.

Daily Words and Leaderboards

By 
Har0x
To encourage competition, I introduced a "daily word" system. Each day, a word from an RSS feed provided by Wordsmith.org is transformed into a password using a custom "Passwordify" function, which replaces certain characters with numbers, symbols, and capital letters. This ensures everyone receives the same word, fostering a shared challenge.

A leaderboard tracks the shortest Brainfuck code solutions for the daily word. It displays player names and code lengths without revealing solutions, focusing the challenge on optimization.

Interactive Execution

By 
Har0x
Initially, code execution was triggered by a button. I later added functionality for real-time execution. The interpreter now runs code as it is typed and updates whenever the text caret moves. This lets players step forward and backward through their code. While loops aren’t visualized in this system, it improves usability significantly.

Challenges and Limitations

By 
Har0x
Infinite Loops

Infinite loops remain a significant technical challenge. Without safeguards, such loops can crash the game. While I’ve included a warning in the help section, accidental infinite loops are still possible. Detecting these loops preemptively is a feature I’d like to explore in the future.

Simplified Help Section

The help section explains each Brainfuck command, highlights limitations, and offers context for new players. Notable deviations from traditional Brainfuck include:
  • Using 16 bytes of looping memory instead of the standard 30,000 bytes or infinite memory.
  • Disabling input commands to maintain the game’s puzzle focus.
While functional, the help section could benefit from a tutorial mode to improve onboarding for new players

Reflecting on the Process

By 
Har0x
This project has been an invaluable learning experience. Key takeaways include:
  • Gaining a deeper understanding of Brainfuck and interpreter design.
  • Learning Razor for UI development.
  • Exploring S&box features like stats and leaderboards.
While I haven’t conducted extensive playtesting yet, I’m eager to gather feedback now that the game is submitted. If time weren’t a constraint, I’d love to expand it into a 3D puzzle adventure with narrative elements and additional challenges.

Future Possibilities

By 
Har0x
The core mechanic could easily adapt to other simple programming languages or custom esoteric languages designed specifically for games. There’s immense potential to combine coding puzzles with gameplay for richer, more interactive experiences.

Thanks for reading, and I hope you enjoy playing the game as much as I enjoyed creating it. Let’s see who can write the shortest Brainfuck solution for today’s daily word!

arrow_back_ios1arrow_forward_ios
trophy 1255
Feb 2023 8 posts
Har0x 4 months ago
#1
Brainfuck Puzzle Game : harox/brainflock/news/brainfuck-2975b925
arrow_back_ios1arrow_forward_ios
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
  • News
  • About
  • Wiki
  • Commits
  • FAQ
  • Discord
  • Twitter