Skip to content

Instantly share code, notes, and snippets.

@neuling
Created August 25, 2013 14:15
Show Gist options
  • Save neuling/6334065 to your computer and use it in GitHub Desktop.
Save neuling/6334065 to your computer and use it in GitHub Desktop.
<script>
n = prompt().split("");
c = "q=n[0];w=n[1];r[x=n.join('')*1] || e(y[(x+'').length])";
t = "tausend"; h = "hundert";j='zig';
y=[,,"w==0?r[q]+j:(q==1?r[w]+r[10]:r[w]+'und'+(i[q]||r[q]+j))","n.shift();r[q]+h+e(c)","n=n.slice(-3);r[q]+t+e(c)","k=n.splice(2);u=e(c);n=k;u+t+e(c)","e(y[5].replace(2,3))"];
r="0ein0zwei0drei0vier0fuenf0sechs0sieben0acht0neun0zehn0elf0zwölf".split(0);
r[20]="zwanzig";r[30]="dreißig";i=[,,r[20],r[30]];
alert((e = eval)(c).replace(/(en|s)z/,'z').replace(/in$/,'$1s'))
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment