Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let result = "";
- let row;
- for (row = 1; row <= 5; row++) {
- result = "";
- for (column = 1; column <= 5; column++) {
- if ((row == 1 || row == 5) && (column == 1 || column == 5)) {
- result = result + "0";
- } else if ((row == 1 || row == 5) && (column != 1 || column != 5)) {
- result = result + "1";
- }
- if (row != 1 && row != 5) {
- if (column == 2 || column == 3 || column == 4) {
- result = result + "0";
- } else {
- result = result + "1";
- }
- }
- }
- console.log(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement