RE: Post making contest
06-04-2016, 08:29 PM
(This post was last modified: 06-04-2016, 08:32 PM by Kaynato.)
(06-04-2016, 07:56 PM)CrimsonMage Wrote: »
.. .----. -- / .... .- ...- .. -. --. / ... --- / -- ..- -.-. .... / ..-. ..- -. / .--- ..- ... - / .--. --- ... - .. -. --. / -.-- --- ..- - ..- -... . / ...- .. -.. . --- ...
(06-04-2016, 05:20 PM)Kaynato Wrote: »G0od pun.
... ..- .-. . / .. ... --..-- / -... . -.-. .- ..- ... . / .. - / ..- ... . -.. / --. --- --- -.. / .-- --- .-. -.. .--. .-.. .- -.-- .-.-.-
.. - / .. ... / .- / ... . -.-. .-. . - / - --- / . ...- . .-. -.-- --- -. . .-.-.-
..-. .. ... .... -....- ... .... .- .--. . -.. / ..-. .. ... .... / - .- ... - . / .-.. .. -.- . / ..-. .. ... .... --..-- / -.-. . .-. - .- .. -. .-.. -.-- --..-- / .- ... / --- -. .-.. -.-- / ..-. .. ... .... -....- ... .... .- .--. . -.. / ..-. .. ... .... / -.. --- --..-- / .- ... / --- .--. .--. --- ... . -.. / - --- / .-- .- - . .-. -- . .-.. --- -. -....- ... .... .- .--. . -.. / .-- .- - . .-. -- . .-.. --- -. ... / .-- .... .. -.-. .... / -.. --- / -. --- - / - .- ... - . / .-.. .. -.- . / ..-. .. ... .... --..-- / .-.. .. -.- . / ..-. .. ... .... -....- ... .... .- .--. . -.. / ..-. .. ... .... / - .- ... - . / .-.. .. -.- . / ..-. .. ... .... .-.-.-
This post passes rules 1, 2, 3, 4, and 5!
Congratulations!
RULES ARE THUS:
Rule 1: "Secret" - Post must contain a secret or be a secret.
Rule 2: "Graph" - Post must have more dots than lines. Judged via script.
Rule 3: "Euphonic" - Post must have words that begin with consecutive musical notes (A through G) that form a major triad.
Rule 4: "Yes" - Post must agree with at least one statement in the previous post and provide a reason regardless of veracity.
Rule 5: "Hell" - Post must describe a hell. A hell must have a punishment and a condition of entry.
The passing post had "BURNING TO DEATH (a lot)" as the punishment and "NOT BEING MINE" as the condition of entry for the hell.
EDIT: Script stuff:
Sometimes I needed to manually judge (with rule 3 or weird text symbols for rule 2) - images and videos didn't count unless incredibly obviously just dots and/or dashes / lines.
Script:
Code:
var DAHS = [
"bdefhimnpqrtuBDIP2!%-_|\/\\",
"vxGLRTVX157$^=+<>",
"kzAFHKNYZ4[]",
"wEMW#"
];
var DITS = [
".!?ij;",
":"
]
function sanitize(str) {
return str.replace(/ |<\/span>\w+ Wrote: |<[^<>]*>|\(Today \d+:\d+ [AP]M\)|<[^<>]*>|\(Yesterday \d+:\d+ [AP]M\)/g, "");
}
function satis2(str) {
var sum = 0;
var dot = 0;
var das = 0;
// Foreach char, tally dotdash
for (var i = 0; i < str.length; i++) {
var bl = dnum(str.charAt(i));
sum += bl[0];
dot += bl[1];
das += bl[2];
}
return [sum > 0, dot, das];
}
function satis3(str) {
str = letextract(str);
var mus = '';
var c = '';
for (var i = 0; i < str.length; i++) {
var ch = str[i];
// Nil state
if (mus == '')
mus += ch;
// a
else if (mus[0] == 'a') {
// ac af
if (strhas('cf', mus[1])){mus+=ch;if(mus=='acf'||mus=='afc')return mus; else mus=ch;}
// a
else if(mus.length==1)mus=strhas('cf',ch)?mus+ch:ch;}
// b
else if (mus[0] == 'b') {
// bd bg
if (strhas('dg', mus[1])){mus+=ch;if(mus=='bdg'||mus=='bgd')return mus;else mus=ch;}
// b
else if(mus.length==1)mus=strhas('dg',ch)?mus+ch:ch;}
// c
else if (mus[0] == 'c') {
// ca cf
if (strhas('af', mus[1])){mus+=ch;if(mus=='caf'||mus=='cfa')return mus;else mus=ch;}
// ce cg
else if (strhas('eg', mus[1])){mus+=ch;if(mus=='ceg'||mus=='cge')return mus;else mus=ch;}
// c
else if(mus.length==1)mus=strhas('afeg',ch)?mus+ch:ch;}
// d
else if (mus[0] == 'd') {
// db dg
if (strhas('bg', mus[1])){mus+=ch;if(mus=='dbg'||mus=='dgb')return mus;else mus=ch;}
// d
else if(mus.length==1)mus=strhas('bg',ch)?mus+ch:ch;}
// e
else if (mus[0] == 'e') {
// ec eg
if (strhas('cg', mus[1])){mus+=ch;if(mus=='ecg'||mus=='egc')return mus;else mus=ch;}
// e
else if(mus.length==1)mus=strhas('cg',ch)?mus+ch:ch;}
// f
else if (mus[0] == 'f') {
// fc fa
if (strhas('ca', mus[1])){mus+=ch;if(mus=='fca'||mus=='fac')return mus;else mus=ch;}
// f
else if(mus.length==1)mus=strhas('ca',ch)?mus+ch:ch;}
// g
else if (mus[0] == 'g') {
// gd gb
if (strhas('db', mus[1])){mus+=ch;if(mus=='gdb'||mus=='gbd')return mus;else mus=ch;}
// gc ge
else if (strhas('ce', mus[1])){mus+=ch;if(mus=='gce'||mus=='gec')return mus;else mus=ch;}
// g
else if(mus.length==1)mus=strhas('bcde',ch)?mus+ch:ch;}
else
mus = ch;
}
return mus;
}
function letextract(str) {
var list = str.match(/\b\w/g);
if (list == null)
return '';
str = "";
for (var i = 0; i < list.length; i++)
str += list[i];
return str.toLowerCase();
}
function strhas(str, char) {
return str.indexOf(char) != -1;
}
function dnum(char) {
var dot = 0;
var das = 0;
for (var i = 0; i < DITS.length; i++)
if (DITS[i].indexOf(char) != -1)
dot = i+1;
for (var i = 0; i < DAHS.length; i++)
if (DAHS[i].indexOf(char) != -1)
das = i+1;
return [dot - das, dot, das];
}
function tos2(bl) {
var out = '';
out += bl[0] ? "PASSES" : "FAILS";
out += " 2";
out += " with "+bl[1]+" dots and ";
out += bl[2]+" dashes.<br>";
return out;
}
function tos3(bl) {
var out = '';
out += bl.length == 3 ? "PASSES" : "FAILS";
out += " 3";
out += " had "+bl.toUpperCase()+"<br>";
return out;
}
function scan() {
var posts = $('.post_body');
// For each post
for (var i = 0; i < posts.length; i++) {
var iht = posts[i].innerHTML;
var output = "";
var siht = sanitize(iht);
output += tos2(satis2(siht));
output += tos3(satis3(siht));
posts[i].innerHTML = iht.concat("<code><br>"+output+"</code>");
}
}
scan();
/*Rules:
Rule 1: "Secret" - Post must contain a secret or be a secret.
Rule 2: "Graph" - Post must have more dots than lines. Judged via script.
Rule 3: "Euphonic" - Post must have words that begin with consecutive musical notes (A through G) that form a major triad.
Rule 4: "Yes" - Post must agree with at least one statement in the previous post and provide a reason regardless of veracity.
Rule 5: "Hell" - Post must describe a hell. A hell must have a punishment and a condition of entry.
*/