eating tofu

master
Boyana 2 years ago
parent f331e08400
commit 3a8c7e57f5

@ -31,6 +31,13 @@
<th>Cyrillic</th>
<th>Emoji</th>
</tr>
<tr>
<td id="BIN"></td>
<td id="HEX"></td>
<td id="DC"></td>
<td id="CY"></td>
<td id="E"></td>
</tr>
</table>
</body>
@ -65,8 +72,10 @@
']': 'sht',
'[': 'sh',
'|': 'yu',
' ': ' ',
}
e = {
' ': ' ',
'a': '📇',
'b': '🚝',
'c': '🚱',
@ -103,18 +112,31 @@ e = {
var charles = document.getElementById("input").value;
var charlesBinary="";
var charlesHex="";
var charlesDc="";
var charlesDec="";
var charlesCY="";
var charlesE="";
for (var i=0;i<charles.length;i++){
console.log(i,charles.charCodeAt(i));
charlesBinary=charlesBinary+charles.charCodeAt(i).toString(2);
charlesHex=charlesHex+charles.charCodeAt(i).toString(16);
charlesDc=charlesDc+charles.charCodeAt(i).toString(10);
charlesDec=charlesDec+charles.charCodeAt(i).toString(10);
if (d[charles[i]]==null){
charlesCY=charlesCY+"□";
}else{
charlesCY=charlesCY+d[charles[i]];
}
if (e[charles[i]]==null){
charlesE=charlesE+"□";
}else{
charlesE=charlesE+e[charles[i]];
}
console.log(charles,charlesBinary,charlesHex,charlesDc,charlesCY,charlesE);
}
console.log(charles,charlesBinary,charlesHex,charlesDec,charlesCY,charlesE);
document.getElementById("E").innerText=charlesE;
document.getElementById("BIN").innerText=charlesBinary;
document.getElementById("DC").innerText=charlesDec;
document.getElementById("HEX").innerText=charlesHex;
document.getElementById("CY").innerText=charlesCY;
}
</script>
</html>

Loading…
Cancel
Save