|
@@ -223,7 +223,7 @@ function chessOneLine() {
|
|
|
}
|
|
|
return console.log(string)
|
|
|
}
|
|
|
-chessOneLine()
|
|
|
+// chessOneLine()
|
|
|
///////////////
|
|
|
|
|
|
|
|
@@ -253,26 +253,28 @@ function chess(){
|
|
|
let x = +prompt("Please write a size of horizontal")
|
|
|
let y = +prompt("Please write a size of vertical")
|
|
|
for(let i = 0; i < y; y--){
|
|
|
- for(let j = 0; j < x; x--) {
|
|
|
+ for(let j = x; j > 0; j--) {
|
|
|
if(y % 2 === 0){
|
|
|
- if(x % 2 === 0) {
|
|
|
+ if(j % 2 === 0) {
|
|
|
string += "#";
|
|
|
} else {
|
|
|
string += ".";
|
|
|
}
|
|
|
} else {
|
|
|
- if(x % 2 === 0) {
|
|
|
+ if(j % 2 === 0) {
|
|
|
string += ".";
|
|
|
} else {
|
|
|
string += "#";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
desk += string + "\n"
|
|
|
+ string = "";
|
|
|
}
|
|
|
console.log(desk)
|
|
|
}
|
|
|
-// chess()
|
|
|
+chess()
|
|
|
////////////
|
|
|
|
|
|
|