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

  • 2
    take the game right, and write them in the form of an algorithm. Well, or at least in words describe the sequence of actions (algorithm). It is unlikely that anyone will write several classes for you, but if you start yourself and come across a problem, you will be happy to help. - Victor
  • Victor is right. describe the algorithm and tell us exactly which place of this algorithm causes you difficulties and how these difficulties are expressed. if you don’t understand how to do it at all, this is one case, if you don’t understand how to do it specifically on java — completely different, and if you write something and it doesn’t work or doesn’t work correctly, the third one and so on. d. the more accurately describe the problem, the faster you will receive the answer and the better the response will be - Dmitry

0