An artificial intelligence programming contest with game software is one of the most effective way of learning programming. Contestants can spontaneously learn programming to win in such contests. Although our previous work helps to hold artificial intelligence programming contests, its effectiveness is limited owing to an insufficient requirement analysis and uses of an unrefined design pattern. In this paper, we report on ACM Java Challenge 2012, that is an artificial intelligence programming contest. we elicit requirements on a contest with a goal oriented requirements analysis and extend the state design pattern using Scala to hold Java Challenge 2012. We evaluate Java Challenge 2012 very highly by questionnaire investigation.