package blevins.emoticon
object App extends Application {
import Emoticon._
val emoticons: List[Emoticon] =
List(
( ^ _ ^ ) ,
( ^ o ^ ) ,
d ( ^ _ ^ ) b ,
( T _ T ) ,
( Z . Z )
)
for ( f <- emoticons ) { f.print }
}
It outputs the following:
(^_^)
(^o^)
d(^_^)b
(T_T)
(Z.Z)
The contents of the Emoticon object is left as an exercise for the reader. Note that I was unable to do the (-.-)Zzz emoticon, but maybe that is just because I didn't try hard enough.
If this doesn't convince you to return to Java, nothing will...
0 comments:
Post a Comment