Very nice, TC01. It's nice to see people are still making these

11,706,151,769: tev rev
11,895,045,730: vim worldev
12,604,135,090: worldashes
12,354,811,494: kermm fax
14,088,517,349: merth tap
28,533,895,972: zshell
24,144,003,504: k nikky
51,317,157,485: erm nikky
64,542,831,540: nikky um
63,089,641,441: gj merth
61,302,871,287: vhs kermm
64,158,295,887: ate readme
"""
---Merthese Interpreter---
The user enters text, which gets interpreted by merthese interpreter.
Merthese's design was made by Shaun McFall
The Python Merthese Interpreter was made by David Gomes
"""
import random #Required for the length of the string
def merthese_interprete(a):
"""Interpretes a string of merthese code, must be newline stripped"""
h_flag = False
all_characters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
"w", "x", "y", "z"]
a = list(a) #turns the string a to an array of characters
for i in range(len(a)):
if a[i] != "h" and h_flag: #if looking for an h and character is not h
continue
if a[i] == "m":
print "merth",
if a[i] == "e":
print "" #print makes a new line by default
if a[i] == "r":
print " ",
if a[i] == "t":
#on this version, the string length is not 13.4, but 13
random_string_length = random.randint(0,13) #[0,13] length
random_string = ""
for i in range(random_string_length):
random_string += random.choice(all_characters)
print random_string,
if a[i] == "h":
h_flag = not h_flag
if __name__ == "__main__":
merthese_code = raw_input()
merthese_interprete(merthese_code)
#!/usr/bin/perl
use strict;
use warnings;
sub rand_string($ ) {
my $chars = shift;
my $ret = "";
$ret .= chr(int(rand(26)) + ord("a"))
while ($chars--);
return $ret;
}
sub merthese($ ) {
my $string = shift;
my $inh = 0;
for (my $i=0; $i<length $string; $i++) {
my $char = substr $string, $i, 1;
$inh = ! $inh if ($char eq "h");
if (!$inh) {
print "merth" if ($char eq "m");
print " " if ($char eq "e");
print "\n" if ($char eq "r");
print rand_string(int(rand(13.4)))
if ($char eq "t");
}
}
}
sub merthese2($ ) {
my $string = shift;
my $inh = 0;
my %letters = (
m => sub { print "merth" if (!$inh) },
e => sub { print " " if (!$inh) },
r => sub { print "\n" if (!$inh) },
t => sub { print rand_string(int(rand(13.4))) if (!$inh) },
h => sub { $inh = !$inh }
);
for (my $i=0; $i<length $string; $i++) {
my $char = substr $string, $i, 1;
$letters{$char}->()
if (defined $letters{$char});
}
}
print "merthese:\n";
merthese "merth is super cool";
print "\nmerthese2:\n";
merthese2 "kerm has doofy hair";
#!/bin/bash
inh=
label=0
IFS=rawr
function compile() {
read -N 1 -r char || return $?
case $char in
v)
[ -z "$inh" ] && cat <<EOF
getstatic java/lang/System/out Ljava/io/PrintStream;
iload_0
i2c
invokestatic Merthese/rot13 (C)C
invokevirtual java/io/PrintStream/print (C)V
EOF
;;
y)
if [ -z "$inh" ]; then
read -N 1 -r nextchar || nextchar='\0'
local labelback
labelback=$label
((label++))
cat <<EOF
bipush '$nextchar'
loop_$labelback:
$(compile)
iconst_1
isub
dup
ifne loop_$labelback
pop
pool_$labelback:
EOF
fi
;;
i)
[ -z "$inh" ] && cat <<EOF
aload_1
invokevirtual java/io/InputStreamReader/read ()I
istore_0
EOF
;;
n)
if [ -z "$inh" ]; then
read -N 1 -r nextchar || nextchar='\0'
cat <<EOF
iinc 0 '$nextchar'
EOF
fi
;;
k)
[ -z "$inh" ] && cat <<EOF
invokestatic Merthese/randBool ()B
ifne skip_$label
iload_0
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
goto pisk_$label
skip_$label:
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc "nikky"
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
pisk_$label:
EOF
((label++))
;;
m)
[ -z "$inh" ] && cat <<EOF
getstatic java/lang/System/out Ljava/io/PrintStream;
invokestatic Merthese/randBool ()B
ifne skip_$label
ldc "merth"
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
goto pisk_$label
skip_$label:
iload_0
invokevirtual java/io/PrintStream/print (I)V
pisk_$label:
EOF
((label++))
;;
e)
[ -z "$inh" ] && cat <<EOF
invokestatic Merthese/randTriple ()I
dup
iflt skip_2_$label
ifgt skip_$label
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc " "
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
goto pisk_$label
skip_$label:
iinc 0 1
goto pisk_$label
skip_2_$label:
pop
ldc ".,;:-!?'" ; 8 len
invokestatic java/lang/Math/random ()D
ldc2_w 8.0D
dmul
d2i
invokevirtual java/lang/String/charAt (I)C
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
pisk_$label:
EOF
((label++))
;;
r)
[ -z "$inh" ] && cat <<EOF
invokestatic Merthese/randBool ()B
ifne skip_$label
getstatic java/lang/System/out Ljava/io/PrintStream;
invokevirtual java/io/PrintStream/println ()V
goto pisk_$label
skip_$label:
iconst_0
istore_0
pisk_$label:
EOF
((label++))
;;
t)
[ -z "$inh" ] && cat <<EOF
invokestatic Merthese/randBool ()B
ifne skip_$label
invokestatic Merthese/randomString ()V
goto pisk_$label
skip_$label:
invokestatic java/lang/Math/random ()D
ldc2_w 13.4D
dmul
d2i
iload_0
swap
skip_loop_$label:
iload_0
iinc 0 -1
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
iconst_1
isub
dup
ifeq skip_loop_$label
pop
invokestatic Merthese/randBool ()B
ifne skip_nosave_$label
pop
goto pisk_$label
skip_nosave_$label:
istore_0
pisk_$label:
EOF
;;
h)
if [ -z "$inh" ]; then
inh=true
else
inh=
fi
;;
esac
return 0
}
cat <<EOF
.class Merthese
.method static randomString()V
.limit locals 1
.limit stack 5
invokestatic java/lang/Math/random ()D
ldc2_w 13.4D
dmul
d2i
istore_0
loop:
invokestatic java/lang/Math/random ()D
ldc2_w 26.0D
dmul
d2i
bipush 'a'
iadd
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
iload_0
iinc 0 -1
ifne loop
done:
return
.end method
.method static randTriple ()I
.limit locals 1
.limit stack 5
invokestatic java/lang/Math/random ()D
ldc2_w 3.0D
dmul
d2i
iconst_1
isub
ireturn
.end method
.method static randBool ()B
.limit locals 1
.limit stack 5
invokestatic java/lang/Math/random ()D
ldc2_w 0.5D
dcmpg
ifgt true
false:
bipush 0
ireturn
true:
bipush 1
ireturn
.end method
.method static rot13 (C)C
.limit locals 1
.limit stack 5
iload_0
bipush 'a'
if_icmpge check_lower
iload_0
bipush 'A'
if_icmpge check_upper
iload_0
ireturn
check_lower:
iload_0
bipush 'z'
if_icmple rotate_lower
iload_0
ireturn
check_upper:
iload_0
bipush 'Z'
if_icmple rotate_upper
iload_0
ireturn
rotate_lower:
iload_0
bipush 'a'
isub
bipush 13
iadd
bipush 26
irem
bipush 'a'
iadd
ireturn
rotate_upper:
iload_0
bipush 'A'
isub
bipush 13
iadd
bipush 26
irem
bipush 'A'
iadd
ireturn
.end method
.method static run ()V
.limit locals 3
.limit stack 20
iconst_0
istore_0
new java/io/InputStreamReader
dup
getstatic java/lang/System/in Ljava/io/InputStream;
invokespecial java/io/InputStreamReader/<init> (Ljava/io/InputStream;)V
astore_1
EOF
while true; do
compile "$char" || break
done
cat <<EOF
return
.end method
.end class
EOF
nikkyjj
106106
.class Merthese
.method static randomString()V
.limit locals 1
.limit stack 5
invokestatic java/lang/Math/random ()D
ldc2_w 13.4D
dmul
d2i
istore_0
loop:
invokestatic java/lang/Math/random ()D
ldc2_w 26.0D
dmul
d2i
bipush 'a'
iadd
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
iload_0
iinc 0 -1
ifne loop
done:
return
.end method
.method static randTriple ()I
.limit locals 1
.limit stack 5
invokestatic java/lang/Math/random ()D
ldc2_w 3.0D
dmul
d2i
iconst_1
isub
ireturn
.end method
.method static randBool ()B
.limit locals 1
.limit stack 5
invokestatic java/lang/Math/random ()D
ldc2_w 0.5D
dcmpg
ifgt true
false:
bipush 0
ireturn
true:
bipush 1
ireturn
.end method
.method static rot13 (C)C
.limit locals 1
.limit stack 5
iload_0
bipush 'a'
if_icmpge check_lower
iload_0
bipush 'A'
if_icmpge check_upper
iload_0
ireturn
check_lower:
iload_0
bipush 'z'
if_icmple rotate_lower
iload_0
ireturn
check_upper:
iload_0
bipush 'Z'
if_icmple rotate_upper
iload_0
ireturn
rotate_lower:
iload_0
bipush 'a'
isub
bipush 13
iadd
bipush 26
irem
bipush 'a'
iadd
ireturn
rotate_upper:
iload_0
bipush 'A'
isub
bipush 13
iadd
bipush 26
irem
bipush 'A'
iadd
ireturn
.end method
.method static run ()V
.limit locals 3
.limit stack 20
iconst_0
istore_0
new java/io/InputStreamReader
dup
getstatic java/lang/System/in Ljava/io/InputStream;
invokespecial java/io/InputStreamReader/<init> (Ljava/io/InputStream;)V
astore_1
invokestatic Merthese/randBool ()B
ifne skip_0
invokestatic Merthese/randomString ()V
goto pisk_0
skip_0:
invokestatic java/lang/Math/random ()D
ldc2_w 13.4D
dmul
d2i
iload_0
swap
skip_loop_0:
iload_0
iinc 0 -1
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
iconst_1
isub
dup
ifeq skip_loop_0
pop
invokestatic Merthese/randBool ()B
ifne skip_nosave_0
pop
goto pisk_0
skip_nosave_0:
istore_0
pisk_0:
invokestatic Merthese/randTriple ()I
dup
iflt skip_2_0
ifgt skip_0
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc " "
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
goto pisk_0
skip_0:
iinc 0 1
goto pisk_0
skip_2_0:
pop
ldc ".,;:-!?'" ; 8 len
invokestatic java/lang/Math/random ()D
ldc2_w 8.0D
dmul
d2i
invokevirtual java/lang/String/charAt (I)C
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
pisk_0:
getstatic java/lang/System/out Ljava/io/PrintStream;
iload_0
i2c
invokestatic Merthese/rot13 (C)C
invokevirtual java/io/PrintStream/print (C)V
iinc 0 'i'
invokestatic Merthese/randBool ()B
ifne skip_1
iload_0
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
goto pisk_1
skip_1:
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc "nikky"
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
pisk_1:
invokestatic Merthese/randBool ()B
ifne skip_2
iload_0
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
goto pisk_2
skip_2:
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc "nikky"
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
pisk_2:
bipush ' '
loop_3:
invokestatic Merthese/randBool ()B
ifne skip_4
iload_0
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
goto pisk_4
skip_4:
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc "nikky"
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
pisk_4:
iconst_1
isub
dup
ifne loop_3
pop
pool_3:
invokestatic Merthese/randTriple ()I
dup
iflt skip_2_4
ifgt skip_4
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc " "
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
goto pisk_4
skip_4:
iinc 0 1
goto pisk_4
skip_2_4:
pop
ldc ".,;:-!?'" ; 8 len
invokestatic java/lang/Math/random ()D
ldc2_w 8.0D
dmul
d2i
invokevirtual java/lang/String/charAt (I)C
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
pisk_4:
invokestatic Merthese/randBool ()B
ifne skip_5
getstatic java/lang/System/out Ljava/io/PrintStream;
invokevirtual java/io/PrintStream/println ()V
goto pisk_5
skip_5:
iconst_0
istore_0
pisk_5:
getstatic java/lang/System/out Ljava/io/PrintStream;
invokestatic Merthese/randBool ()B
ifne skip_6
ldc "merth"
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
goto pisk_6
skip_6:
iload_0
invokevirtual java/io/PrintStream/print (I)V
pisk_6:
getstatic java/lang/System/out Ljava/io/PrintStream;
invokestatic Merthese/randBool ()B
ifne skip_7
ldc "merth"
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
goto pisk_7
skip_7:
iload_0
invokevirtual java/io/PrintStream/print (I)V
pisk_7:
invokestatic Merthese/randTriple ()I
dup
iflt skip_2_8
ifgt skip_8
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc " "
invokevirtual java/io/PrintStream/print (Ljava/lang/String;)V
goto pisk_8
skip_8:
iinc 0 1
goto pisk_8
skip_2_8:
pop
ldc ".,;:-!?'" ; 8 len
invokestatic java/lang/Math/random ()D
ldc2_w 8.0D
dmul
d2i
invokevirtual java/lang/String/charAt (I)C
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
pisk_8:
invokestatic Merthese/randBool ()B
ifne skip_9
getstatic java/lang/System/out Ljava/io/PrintStream;
invokevirtual java/io/PrintStream/println ()V
goto pisk_9
skip_9:
iconst_0
istore_0
pisk_9:
invokestatic Merthese/randBool ()B
ifne skip_10
invokestatic Merthese/randomString ()V
goto pisk_10
skip_10:
invokestatic java/lang/Math/random ()D
ldc2_w 13.4D
dmul
d2i
iload_0
swap
skip_loop_10:
iload_0
iinc 0 -1
i2c
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/print (C)V
iconst_1
isub
dup
ifeq skip_loop_10
pop
invokestatic Merthese/randBool ()B
ifne skip_nosave_10
pop
goto pisk_10
skip_nosave_10:
istore_0
pisk_10:
invokestatic Merthese/randBool ()B
ifne skip_10
getstatic java/lang/System/out Ljava/io/PrintStream;
invokevirtual java/io/PrintStream/println ()V
goto pisk_10
skip_10:
iconst_0
istore_0
pisk_10:
return
.end method
.end class
Advertisement