8
1
Note to Moderators and editors: This post's title is for effect and should not be changed. The misspelling is intentional and part of the challenge.
Backstory
The (stereo)typical bad SO question asks something along the lines of "plz send teh codez!" In other words, it asks someone to do the work for the asker and provide a complete solution to a one-time problem. I quote this question on Meta.SE:
...its about a specific category of questions which consist of absolutely no research, no effort, and simply ask for the complete solution to a problem. These types of questions generally tend to assume that Stack Overflow is a free coding service...
So what is your actual challenge? Its simple:
Your program or function, etc. must take input as a string (from STDIN, parameter, etc.) and if the string contains Plz send teh codez!
output -1 flag comment
(downvote, flag as off-topic, and comment about how bad a question it is.) Otherwise output +1
(you are upvoting).
But wait… there's more!
Your program must not contain 5 or more of these character sets:
- All special characters (anything not a space, newline (
0x0a
), case-insensitive alphabet, or digit) - Any digit (0-9)
- Any of
pzcm
(case-insensitive) - Any of
hten
(case-insensitive) - Any of
qwryuioasdfgjklxvb
- Any of
QWRYUIOASDFGJKLXVB
To be clear, you can only use up to 4 of those charsets.
Spaces, tabs and newlines are not restricted in any way, but they still are included in your byte count
Final restriction
Your program must contain Unicode ONLY in the range of 0x20
(space) to 0x7e
(~), as well as 0x0a
(LF newline) and 0x09
(tab). This is to exclude code golfing languages and give traditional languages a change or at least level the playing field.
Notes:
- This is code-golf, the shortest answer in bytes wins!
- Input can be from STDIN, a function parameter, command-line parameter, etc. but not a variable.
- Output can be to STDOUT, a function return value, or even an error/exception. Can include a trailing newline.
- Traditional languages are encouraged to compete because this challenge bans a lot of golfing languages by excluding high Unicode characters. C might even have a chance of winning!
- Any questions? Comment below!
If it's too hard…
You can ignore the character sets in your answer, but it then becomes non-competitive.
NOTE: You can now use up to 4 character sets. You're welcome.
You can use this snippet to check if your code is valid:
let f = code => {
let sets = Array(6).fill(false);
code = code.replace(/\s/g, "");
code = code.replace(/\d/g, _ => (sets[0] = true, ""));
code = code.replace(/[pzcm]/gi, _ => (sets[1] = true, ""));
code = code.replace(/[hten]/gi, _ => (sets[2] = true, ""));
code = code.replace(/[qwryuioasdfgjklxvb]/g, _ => (sets[3] = true, ""));
code = code.replace(/[QWRYUIOASDFGJKLXVB]/g, _ => (sets[4] = true, ""));
if (code) sets[5] = true;
return sets.reduce((a, b) => a + b, 0);
}
<textarea oninput="var x=f(value);O.innerHTML='You\'re using '+x+' charset'+(x===1?'':'s')+(x>4?', which is too many.':'. Nice job!')"></textarea><br>
<p id=O></p>
Nice abuse of JSFuck logic! – Matthew Roh – 2017-04-01T23:36:17.350