10
My coworker and I work on a legacy piece of software that we hate sometimes. Whenever you run it, debug asserts come flying everywhere, and it's never a guarantee that anything will work. The motivation for this round of code golf came from my coworker saying the following about our software.
"It's like every time you run this program, you're agreeing to some terms of service that says every 17th bit on your hard drive will be turned into a 1"
Goal: Write a program that will make an exact copy of a file and turn every 17th bit of a text file into a 1
- You may NOT turn EVERY bit of the file to a 1. i.e. your program must show some intelligence that it is only targeting every 17th bit
- You may NOT write to the original file in any way shape or form
- The Winner is the smallest program submission at the end of the month
Have fun with this one! Go!
7>
code-golf
, i.e., shortest code in bytes wins. Acode-challenge
needs a well specified scoring system. 2. Turning every 18th bit of a hard drive into a 1 is only possible by writing directly to the drive. This cannot be accomplished by creating and/or modifying files. 3. Doing this will render the entire drive unusable, so a compliant solution will be destructive. I don't know how well the community will receive a request to write malware...@Dennis I agree with the closing of the question, but I do not agree with the reason (I see you were not among the close voters.) I personally had no problem with the insult question, but requesting malware is different. It's irresponsible and potentially criminal, so this question should remain closed. Given that a stack exchange employee closed the insult question (and many people lost a lot of reputation overnight) this question would definitely be deleted too. http://meta.codegolf.stackexchange.com/q/1638/15599.
– Level River St – 2014-09-03T08:21:49.170If the most votes wins, you need to have tagged this a [tag:popularity-contest] – Beta Decay – 2014-09-03T14:46:52.270
I am not requesting malware! I had a funny experience at work yesterday and thought "Hmm, maybe that would be a fun way to jump into the code golf community." Anyway, I modified the rules a little bit because I see your point. My intention was not to be criminal or irresponsible. – C. Tewalt – 2014-09-03T14:48:53.253
@matrixugly if you have a the popularity contest tag, you should remove the code challenge tag – proud haskeller – 2014-09-03T17:35:39.407
I made a bunch of edits, can it not be off topic anymore? – C. Tewalt – 2014-09-03T19:12:07.890
@matrixugly OK, I realise you're new round here, but if the rules state that the submitted program must corrupt the hard drive that's what valid entries must do, and we don't want to become a manual for writing malware. Changing it to text is a lot more innocuous, and most people know the structure of text files anyway. I've changed my downvote to an upvote, but I'm holding off on the reopen vote, because I think a question like this would go best as code-golf (shortest code) and not popularity-contest (most votes.) – Level River St – 2014-09-04T16:22:54.240
2I'd vote to re-open this question, if only I had enough rep.
:/
– Sammitch – 2014-09-04T19:14:13.5103@steveverrill I'll change it to code golf, however I'm going to change it from 18th bit to 17th bit, to make things interesting. – C. Tewalt – 2014-09-04T22:48:09.137
1@matrixugly 17th bit certainly is more interesting. Bear in mind that it is not good form to change the rules in a way that invalidates existing answers (that's why questions get put on hold, in order to avoid answers being posted that make the question impossible to fix.) However the existing answer doesn't comply with other current rules anyway, so it's not a big problem in this case. – Level River St – 2014-09-04T23:50:43.447
1How is the file read in? stdin? – Milo – 2014-09-05T03:55:18.110
1Do we have to write the edited file to another file or can we just leave it? – Beta Decay – 2014-09-05T09:16:55.983
Do the file need to be written to the disk or a memory/printed representation is ok ? – sebcap26 – 2014-09-05T11:33:10.513