package ru.job4j.loop;
/**
 * Class Board.
 *
 * @author Alexey Leishin (lepishin.ao@yandex.ru)
 * @version 1
 * @since 08.05.2017
 */
public class Board {
	/**
	 * paint.
	 * @param width width.
	 * @param height height.
	 * @return result.
	 */
	public String paint(int width, int height) {
		StringBuilder sBuilder = new StringBuilder("");
		for (int i = 1; i <= height; i++) {
			for (int j = 1; j <= width; j++) {
				if (i % 2 == 0) {
					if (j % 2 == 0) {
						sBuilder.append("x");
					} else {
						sBuilder.append(" ");
					}
					// j % 2 == 0 ? (sBuilder.append("x")) : (sBuilder.append(" "));
				} else {
					if (j % 2 == 0) {
						sBuilder.append(" ");
					} else {
						sBuilder.append("x");
					}
					// j % 2 == 0 ? (sBuilder.append(" ")) : (sBuilder.append("x"));
				}
			}
			sBuilder.append("\r\n");
		}
		String result = sBuilder.toString();
		return result;
	}
}
@@ -338,16 +338,17 @@
 (%22%22);%0A%09%09
+%09
 for (int
@@ -374,24 +374,25 @@
 ; i++) %7B%0A%09%09%09
+%09
 for (int j =
@@ -418,40 +418,24 @@
 ) %7B%0A
+%09
 %09%09%09%09if 
+(
 (i 
-%25 2 == 0) %7B%0A%09%09%09%09%09if (j
++ j)
  %25 2
@@ -528,260 +528,72 @@
 %09%09%09%09
-%09// j %25 2 == 0 ? (sBuilder.append(%22x%22)) : (sBuilder.append(%22 %22));%0A%09%09%09%09%7D else %7B%0A%09%09%09%09%09if (j %25 2 == 0) %7B%0A%09%09%09%09%09%09sBuilder.append(%22 %22);%0A%09%09%09%09%09%7D else %7B%0A%09%09%09%09%09%09sBuilder.append(%22x%22);%0A%09%09%09%09%09%7D%0A%09%09%09%09%09// j %25 2 == 0 ? (sBuilder.append(%22 %22)) : (sBuilder.append(%22x
+%7D%0A%09%09%09%09sBuilder.append(System.getProperty(%22line.separator
 %22));%0A%09%09%09
 %09%7D%0A%09
@@ -592,65 +592,18 @@
 %0A%09%09%09
-%09
 %7D%0A%09%09
-%09%7D%0A%09%09%09sBuilder.append(%22%5Cr%5Cn%22);%0A%09%09%7D%0A%09%09String result =
+return
  sBu
@@ -624,25 +624,8 @@
 ();%0A
-%09%09return result;%0A
 %09%7D%0A%7D

Task 13559+