Mid2 7th_HCF Get link Facebook X Pinterest Email Other Apps - August 07, 2023 def hcf(a, b): if(b == 0): return a else: return hcf(b, a % b)a = 60b = 48# prints 12print("The gcd of 60 and 48 is : ", end="")print(hcf(60, 48))#output:The gcd of 60 and 48 is 12 Get link Facebook X Pinterest Email Other Apps Comments
HANGMAN GAME - July 12, 2024 import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Random; public class Main extends JFrame { private static final String[] WORDS = { "HELLO" , "WORLD" , "COMPUTER" , "JAVA" , "PROGRAMMING" , "ECLIPSE" }; private static final int MAX_TRIES = 6 ; private String wordToGuess ; private char [] guessedLetters ; private int triesLeft ; private JLabel wordLabel ; private JLabel triesLabel ; private JTextField letterInput ; private JButton guessButton ; public Main () { setTitle( "Hangman Game" ); setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE ); setSize( 400 , 300 ); setLocationRelativeTo( null ); // Center window on screen // Initialize game state wordToGuess = selectWord(); guessedLetters = new char [ wordToGuess .length()]; triesLeft = MAX_... Read more
Comments
Post a Comment