In general, the essence of this. There is a bingo game. Four people play it. You need to create a card with 25 numbers for each player (well, like the most common bingo card). There are 75 total numbers. I need help in general how this can be done. Methods, methods and so on. And yet, the mandatory part - you need to use OOP.
I created a class where the card itself is generated with 25 numbers.
public class BingoCard { public static void main(String[] args) { int[][] card = new int[5][5]; ArrayList<Integer> alreadyUsed = new ArrayList<>(); boolean valid = false; int tmp = 0; for (int i = 0; i <= 4; i++) { for (int row = 0; row < card.length; row++) { while (!valid) { tmp = (int) (Math.random() * 15) + 1 + 15 * i; if (!alreadyUsed.contains(tmp)) { valid = true; alreadyUsed.add(tmp); } } card[row][i] = tmp; valid = false; } } card[2][2] = 0; String title[] = {"B", "I", "N", "G", "O"}; for (int i = 0; i < title.length; i++) { System.out.print(title[i] + "\t"); } System.out.println(); for (int row = 0; row < card.length; row++) { for (int col = 0; col < card[row].length; col++) { System.out.print(card[row][col] + "\t"); } System.out.println(); } } } Now you need to create a class with the game itself and the players. How can this be implemented? And yet, everything is displayed in the console, I don’t know anything about the JFrame, I'm new. Any ideas are accepted. Thanks to all