rendered paste bodypublic class sexy { public static void main(String args[]) { char character = 'X'; int times = 5; int repeat = times; boolean enabled = true; String result = ""; for(int i = 1; i != 0;) { if(i % 2 == 0) i = (enabled == true) ? ++i : --i; if(enabled && i == times) enabled = false; else { result += str_repeat(' ',(repeat >= 1 && enabled == true ? repeat-- : repeat++)); result += str_repeat(character,((i >= 1 && enabled == true) ? (i++) : i--))+ "\r\n"; } } System.out.println(result); } public static String str_repeat(char character, int times) { String var = ""; for(int i = 1; i <= times; i++) var += character; return var; }}VÄLJASTAB: X XXX XXXXX XXX X