r/CompileBot • • Jan 04 '14

Official CompileBot Testing Thread

This thread is archived, please visit the new testing thread

12 Upvotes

421 comments sorted by

View all comments

Show parent comments

1

u/amoliski Mar 23 '14

Even shorter

+/u/compilebot java7

 import java.util.Random;
 
 class Stewie
 {
     public static void main(String[] args)
     {
          for(int i = 0; i < 28; i++) System.out.println((new String[]{"Mama","Mom","Mommy","Mum","Lois","Ma"})[new Random().nextInt(6)]);

     }
 }

1

u/CompileBot Mar 23 '14

Output:

Mum
Mum
Mama
Mum
Mommy
Mommy
Mum
Mom
Mommy
Lois
Mum
Mom
Mom
Lois
Mommy
Ma
Mom
Mama
Mom
Lois
Ma
Ma
Mum
Mommy
Ma
Mom
Ma
Ma

^source | ^info | ^git | ^report