Skip to main content
added 218 characters in body
Source Link
Joshua
  • 3.5k
  • 1
  • 20
  • 23

C++, Linux platform, 10 numbers, 468 bytes, Cracked

Ok so previously my puzzle played with technically undefined behavior (and the gimmick was stabilizing it) and had some transcription error. I have improved my process so I expect there aren't transcription errors. This time I am not playing with undefined behavior at all and would rather just reject invoking it. I think I can justify this as being completely defined by either the language or the platform. $ is the replacement character as I needed real _ characters in this puzzle.

#include <unistd.h>
#include <iostream>
#include <fstream>

$$$$$$$$$$$$$ {
    std::ofstream *garbalgase()
    {
        std::ofstream *golgi = new std::ofstream;
        golgi->open("/dev/null");
        return golgi;
    }

    std::ostream * const jawbone = garbalgase();
    $$$$$ int value = $_$$$$$$;
}

int main()
{
    $$$$$ $$$$$$$$/$$int vl = value;
    if (fork() == 0)
    {
        $$$$$$$$$$$<std::ostream $*>($jawbone) = &std::cout;
        vl -= 4;
        _exit(0);
    }
    (*jawbone) << (vl - 9) << std::endl;
}

Edit: Stock solution is based on an incorrect understanding of the rules where you may insert one character to get the 1. As it's already cracked I won't be correcting it. Good luck finding the stock solution though.

C++, Linux platform, 10 numbers, 468 bytes

Ok so previously my puzzle played with technically undefined behavior (and the gimmick was stabilizing it) and had some transcription error. I have improved my process so I expect there aren't transcription errors. This time I am not playing with undefined behavior at all and would rather just reject invoking it. I think I can justify this as being completely defined by either the language or the platform. $ is the replacement character as I needed real _ characters in this puzzle.

#include <unistd.h>
#include <iostream>
#include <fstream>

$$$$$$$$$$$$$ {
    std::ofstream *garbalgase()
    {
        std::ofstream *golgi = new std::ofstream;
        golgi->open("/dev/null");
        return golgi;
    }

    std::ostream * const jawbone = garbalgase();
    $$$$$ int value = $_$$$$$$;
}

int main()
{
    $$$$$ $$$$$$$$/$$int vl = value;
    if (fork() == 0)
    {
        $$$$$$$$$$$<std::ostream $*>($jawbone) = &std::cout;
        vl -= 4;
        _exit(0);
    }
    (*jawbone) << (vl - 9) << std::endl;
}

C++, Linux platform, 10 numbers, 468 bytes, Cracked

Ok so previously my puzzle played with technically undefined behavior (and the gimmick was stabilizing it) and had some transcription error. I have improved my process so I expect there aren't transcription errors. This time I am not playing with undefined behavior at all and would rather just reject invoking it. I think I can justify this as being completely defined by either the language or the platform. $ is the replacement character as I needed real _ characters in this puzzle.

#include <unistd.h>
#include <iostream>
#include <fstream>

$$$$$$$$$$$$$ {
    std::ofstream *garbalgase()
    {
        std::ofstream *golgi = new std::ofstream;
        golgi->open("/dev/null");
        return golgi;
    }

    std::ostream * const jawbone = garbalgase();
    $$$$$ int value = $_$$$$$$;
}

int main()
{
    $$$$$ $$$$$$$$/$$int vl = value;
    if (fork() == 0)
    {
        $$$$$$$$$$$<std::ostream $*>($jawbone) = &std::cout;
        vl -= 4;
        _exit(0);
    }
    (*jawbone) << (vl - 9) << std::endl;
}

Edit: Stock solution is based on an incorrect understanding of the rules where you may insert one character to get the 1. As it's already cracked I won't be correcting it. Good luck finding the stock solution though.

Source Link
Joshua
  • 3.5k
  • 1
  • 20
  • 23

C++, Linux platform, 10 numbers, 468 bytes

Ok so previously my puzzle played with technically undefined behavior (and the gimmick was stabilizing it) and had some transcription error. I have improved my process so I expect there aren't transcription errors. This time I am not playing with undefined behavior at all and would rather just reject invoking it. I think I can justify this as being completely defined by either the language or the platform. $ is the replacement character as I needed real _ characters in this puzzle.

#include <unistd.h>
#include <iostream>
#include <fstream>

$$$$$$$$$$$$$ {
    std::ofstream *garbalgase()
    {
        std::ofstream *golgi = new std::ofstream;
        golgi->open("/dev/null");
        return golgi;
    }

    std::ostream * const jawbone = garbalgase();
    $$$$$ int value = $_$$$$$$;
}

int main()
{
    $$$$$ $$$$$$$$/$$int vl = value;
    if (fork() == 0)
    {
        $$$$$$$$$$$<std::ostream $*>($jawbone) = &std::cout;
        vl -= 4;
        _exit(0);
    }
    (*jawbone) << (vl - 9) << std::endl;
}