Skip to content

Instantly share code, notes, and snippets.

@ttepasse
Created January 3, 2013 03:35
Show Gist options
  • Save ttepasse/4440554 to your computer and use it in GitHub Desktop.
Save ttepasse/4440554 to your computer and use it in GitHub Desktop.
Rövarspråket
/**
* Rövarspråket
*/
html {
background: linear-gradient(0deg, khaki, green);
min-height: 100%;
}
table {
margin: 5em auto
}
th {
font-family: sans-serif;
text-align: left;
font-weight: 100;
color: darkgreen
}
th:last-child {
text-align: right;
}
td, th {
padding: 0em 1em;
}
textarea {
width: 30em;
height: 10em;
font-size: large;
color: darkgreen;
padding: 0.5em
}
<form oninput="robber.value = muggle.value">
<table>
<tr><th>Muggle
<th>Räuber
<tr><td><textarea id="muggle" autsofocus>Test</textarea></td>
<td><textarea id="robber" readonly></textarea></td>
</table>
</form>
CONSONANTS = "bcdfghjklmnpqrsßtvwxzBCDFGHJKLMNPQRSßTVWXZ";
String.prototype.isConsonant = function isConsonant () {
return CONSONANTS.indexOf(this) != -1;
}
String.prototype.convertChar = function convertChar () {
return this.isConsonant() ? this + "o" + this.toLowerCase() : this;
}
function toRobberspeak () {
return this.split("").map(function (char) {
return char.convertChar();
}).join("");
}
{"view":"split","fontsize":"90","seethrough":"","prefixfree":"1","page":"html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment