Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Parzi88334y@SortOfTested it'd have to be written in machine code because of the forward-and-reverse-must-match rule
-
@Parzi
It's an odd request. A code palindrome? I'd ask for some details.
Or maybe just a real problem 😆 -
@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 -
Voxera115854y@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.
-
Voxera115854y@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. -
@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. -
@NoToJavaScript
It might work, but it's also code golf, so managed languages are usually too verbose. -
Voxera115854y@NoToJavaScript sure, question is if they consider that as “an os” or “hardware”.
It might need to be more complete ;) -
@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 !) -
Parzi88334y@NoToJavaScript COMs are unheadered, and "code must read the same forward and backward"
-
@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
> 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/)
rant