Java tutorial
//package com.java2s; public class Main { private static String[] difficultyStrings = { "Need more", "Hard", "Too hard" }; public static String getDifficultyName(int val) { val = Math.min(val / 5, difficultyStrings.length - 1); val = Math.max(val, 0); return difficultyStrings[val]; } }