Generation

generate functionMon, 17 Jul 2023

Ruleta con punteros en java en donde mencione un solo ganadaro con jframe grafico

public class Roulette { public static void main(String[] args) { int winner = (int)(Math.random() * 100); int player1 = (int)(Math.random() * 100); int player2 = (int)(Math.random() * 100); int player3 = (int)(Math.random() * 100); System.out.println("Winner is : " + winner); System.out.println("Player 1 is : " + player1); System.out.println("Player 2 is : " + player2); System.out.println("Player 3 is : " + player3); if (player1 == winner) { System.out.println("Player 1 is the winner!!"); } else if (player2 == winner) { System.out.println("Player 2 is the winner!!"); } else if (player3 == winner) { System.out.println("Player 3 is the winner!!"); } else { System.out.println("Nobody is the winner");

Questions about programming?Chat with your personal AI assistant