.
package com.javarush.task.pro.task05.task0529;
import java.util.Arrays;
/*
Галаксианские роботанки (1)
*/
public class Solution {
public static String robotank = "☖";
public static String empty = "_";
public static String hit = "🎯";
public static int width = 30;
public static int height = 10;
public static int a = 0;
public static String[][] field = new String[height][width];
public static int[][] bombs = new int[height][width];
public static void main(String[] args) {
do {
for (int i = 0; i < height; i++)
{
Arrays.fill(bombs[i], 0);
for (int b = 0; b < 10;)
{
int x = (int) (Math.random() * width);
if (bombs[i][x] != 1)
{
bombs[i][x] = 1;
b++;
}
}
for (int j = 0; j < width; j++)
field[i][j] = empty;
int x = (int) (Math.random() * width);
field[i][x] = robotank;
}
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
if (bombs[i][j] == 1 && field[i][j] == robotank)
{
field[i][j] = hit;
a++;
}
}
} while (a <= 10);
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
System.out.print(field[i][j]);
System.out.println();
}//напишите тут ваш код
}
}