Widget:ARKCode

background-color:black; min-width: 10em; min-height: 27em; display: inline-block; vertical-align: top; writing-mode: vertical-lr; padding: 3px; padding-bottom: 8px; } margin-bottom: -5px; }  var ARKCodeImages = ['https://ark.gamepedia.com/media/ark.gamepedia.com/6/6f/ARKCode0.png?version=c212e9ef2629073ca482172f12731f11', 'https://ark.gamepedia.com/media/ark.gamepedia.com/b/b3/ARKCode1.png?version=bdf880a929f586253368d413dc6bbf33', 'https://ark.gamepedia.com/media/ark.gamepedia.com/a/aa/ARKCode2.png?version=5ba1a8ec9f47306eb4c6c7de2590d23c', 'https://ark.gamepedia.com/media/ark.gamepedia.com/4/40/ARKCode3.png?version=446ed7503fe0b358446d149fe6b1d90b']; function ARKCodeDecode(input) { var code = input.children[0].children[1].value; var codeRep = input.children[1].children[1]; var outputEl = input.children[2].children[1];
 * 1) ARKCodeVisualization{
 * 1) ARKCodeVisualization img{

codeRep.innerHTML = '';

code = code.replace(/[^wasd \n]/g, ''); var output = ''; var codeRepOutput = ''; var ii = 0; var c = 0; for (var i = 0; i < code.length; i++) { if (code[i] == ' ' || code[i] == '\n') { output += ' '; ii = 0; if (code[i] == '\n') { codeRepOutput += ' '; }         continue; }       var add = 0; switch (code[i]) { case 'd': add = 1; break; case 's': add = 2; break; case 'w': add = 3; break; }       c = c * 4 + add;

codeRepOutput += '';

if (ii == 3 || i == code.length - 1) { ii = 0; if (c > 31 && c < 127) output += String.fromCharCode(c); c = 0; } else { ii++; }     }      outputEl.innerHTML = output; codeRep.innerHTML = codeRepOutput; }       Input dasadsdddswadswadsww daadddasdasw dddwdswwdwasdswadsdaasws Visualization Decoded text Decode