Reply To: DashedSentence in a PennController trial

PennController for IBEX Forums FAQ / Tips DashedSentence in a PennController trial Reply To: DashedSentence in a PennController trial


Hello Max,

The special characters in forums posts mess with some characters in javascript code, it’s really frustrating I must say. I tried editing your last message so it displays the javascript code correctly.

In order to make all words appear the same length when masked, would you be willing to use the longest-word’s length for all of them? Because that would make life easier:

showWord = (s,i,m) => '<p>' (w,n) =>
            `<span style='display: inline-block; text-align: center; width: ${m}ch; 
            ${(i===n?'':'border-bottom:solid 1px black;\'><span style=\'visibility:hidden;\'')}'>
        ).join(' ')+'</p>'
dashed = (name, sentence) => {
    let words = sentence.split(' '), maxwidth = 0;>maxwidth=Math.max(w.length,maxwidth));
    return [
        [newText(name, showWord(words,null,maxwidth)).print()], (w,i) => [newKey(`${name}-${i}-${w}`," ").log().wait() , getText(name).text(showWord(words,i,maxwidth))] ),
        [newKey(`${name}-last`," ").log().wait()]

    ...dashed("test","A local man is in a great amount of debt due to gambling.")