MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / completion

Function completion

modules/paulbot/paulbot.js:97–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 }
96
97 function completion() {
98 var timeOnPage = ((+new Date()) - loadTime) + stats.timeOnPage;
99 var wpm = stats.wordCount / (timeOnPage / 1000 / 60);
100
101 var comments = [
102 [0, "That’s insanely slow. How many times have you read it? So thorough! So proud. Or did you just leave the tab open?"],
103 [180, "That’s nice and thorough!"],
104 [250, "That’s the low end of average."],
105 [275, "That’s about average."],
106 [300, "That’s the high end of average."],
107 [350, "That’s pretty fast."],
108 [400, "That’s too fast. You skimmed some, didn’t you?"],
109 [500, "OK that’s just a lie. That cannot be true. You cheated."],
110 [1000, "Hahahahah as if. Nice. Cool. Frankly we expected no more of you."]
111 ];
112
113 var readPerformance = d3.scale.threshold()
114 .domain(comments.map(ƒ(0)).slice(1))
115 .range(comments.map(ƒ(1)));
116
117 var message = "Congratulations! You read " + stats.wordCount + " words in " + (timeOnPage/1000/60).toFixed() + " minutes, which is " + wpm.toFixed() + " words per minute. " + readPerformance(wpm);
118
119 var dialogue = [
120 {
121 "emote": "explaining",
122 "speak": message,
123 "wait": 20000
124 },
125 {
126 "mode": "off"
127 }
128 ];
129
130 module.bot.dialogue(dialogue);
131 }
132
133 // https://css-tricks.com/snippets/jquery/konomi-code/
134 var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected