4
Parzi
22d

> code golf challenge
okay, listening
> easy for beginners
alright, nice, I qualify
> all code must be exactly the same forwards and backwards, >50% of bytes must be run both ways, must run under any OS or system ever made
welp, there goes any hope of being able to fit something into the rules at all

(if you're interested, https://n0.lol/bggp/)

Comments
  • 3
    That sounds like something out of obfuscated C.

    https://www.ioccc.org/
  • 1
    @SortOfTested it'd have to be written in machine code because of the forward-and-reverse-must-match rule
  • 1
    @Parzi
    It's an odd request. A code palindrome? I'd ask for some details.

    Or maybe just a real problem 😆
  • 1
    @SortOfTested i edited the rant with the link.
  • 2
    @Parzi
    Brainfuck would also be a candidate for this, or lua. Depending on how they define executable. Seems like a binary is a binary to them
  • 0
    @SortOfTested I'm totally unsure. I'm assuming final machine code.
  • 1
    @Parzi thats most likely impossible as linux and windows has binary requirements that differ. Only in some higher language could you write code that run under both unless you use some virtual machine, in which case the any os is not really relevant.
  • 2
    @Parzi I think you misunderstood.

    “Any executable format will be accepted, and must run on an operating system or
    piece of hardware that can be physically or virtually run.”

    It states that you can use any format, and that it must be able to run in some environment.

    You cannot just invent your own runtime, unless you build a running version of said runtime.

    But your code does not need to be runnable under all runtimes, just one.
  • 0
    @Voxera i didn't think it had to be under all runtimes?
  • 2
    @Voxera Hmmmmm
    Idea :
    A small « VM » type of code which loads DLL on the fly. (Can even do it with .Net, you can load DLL from MemoryStream)
    If first bytes are “not” header ofd a DLL, reverse memoryStrea then run it.

    Technically it qualifies if you consider “virtualized” the runner and not a part of challange.
  • 1
    @NoToJavaScript
    It might work, but it's also code golf, so managed languages are usually too verbose.
  • 1
    @NoToJavaScript sure, question is if they consider that as “an os” or “hardware”.

    It might need to be more complete ;)
  • 2
    @Voxera If intel 80286 can qualify as “hardware” I think it can be done by playing with some additional data at the end of .com file.
    Basically it does not say the code should be a palindrome. It says it should run if entry point is the end of code. So if you copy the header of .com file and adjust it with “negative” entry point (IP register).
    You could do some weird shit with these processors :)
    /high fives him self for executing 3 apps “simultaneously” on intel 80286 in “unreal” mode. (All while running on MSdos !)
  • 2
    @NoToJavaScript COMs are unheadered, and "code must read the same forward and backward"
  • 1
    @Parzi Ah zut ;p

    edit : yes they are unheadered, but we can add one if needed

    Anyway it's more interesting that to do for 1000th time a CRUD controller
Add Comment