A Micro project report On “Puzzle Game” Submitted under “Advance java programming” To the M.S.B.T.E., Mumbai In Partial Fulfilment of the Requirements For the award of Diploma in Computer Technology By Mr. Pawar Sarthak Vishnu (206) Under the Guidance of Mr. S. B. Jadhav Department of Computer Technology Sanjivani Rural Education Society’s Sanjivani K.B.P. Polytechnic, Kopargaon-423 603 2021 – 2022. Subject Teacher Mr. S. B. Jadhav Head of the Department Mr. G. N. Jorvekar 1 Principal Mr. A. R. Mirikar Micro Project Report on Design A Puzzle Game 1.0 Rationale: We can develop puzzle Game in java with the help of AWT/SWING with event handling. 2.0 Aim: To Prepare a Report On Design a Puzzle Game. 3.0 Course Outcomes: CI503.1 Develop6 Graphical user interface (GUI) programs using AWT and swing component. Arrange the GUI components using different layout manager. CI503.2 Develop6 Event driven programs using the delegation event model , Adapter classes & the inner classes 4.0 Literature review: Based on my research, there are few existing systems found . Firstly , is a mobile app called “Kids Puzzle –Wooden jigsaw” baby wooden jigsaw puzzle, offer hours of FUN for kids. kids and toddlers will be happy to explore different favourite cartoon characters, in addition It will help to develop memory, logical thinking, visual perception and fine motor skills of your babies. 2 5.0 Actual Methodology: The Basic requirements was to create a simple game, where user can able to get different puzzle, able to check and get solution for those puzzles, able to get solution for their own puzzles. `Considering this requirements a simple 9 x 9 grid layout has been made and discussed with users to find out what exactly excepts the user interface to be. Program code: import java.awt.*; import java.awt.event.*; import javax.swing.JOptionPane; public class Puzzle extends Frame implements ActionListener{ Button b1,b2,b3,b4,b5,b6,b7,b8,b9; Puzzle(){ super("Puzzle"); b1=new Button("1"); b1.setBounds(50,100,40,40); b2=new Button("2"); b2.setBounds(100,100,40,40); b3=new Button("3"); b3.setBounds(150,100,40,40); b4=new Button("4"); b4.setBounds(50,150,40,40); b5=new Button("8"); b5.setBounds(100,150,40,40); b6=new Button(""); b6.setBounds(150,150,40,40); b7=new Button("7"); b7.setBounds(50,200,40,40); b8=new Button("6"); b8.setBounds(100,200,40,40); b9=new Button("5"); b9.setBounds(150,200,40,40); b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); b4.addActionListener(this); b5.addActionListener(this); b6.addActionListener(this); 3 b7.addActionListener(this); b8.addActionListener(this); b9.addActionListener(this); add(b1);add(b2);add(b3);add(b4);add(b5);add(b6);add(b7);add(b8);add (b9); setSize(400,400); setLayout(null); setVisible(true); } public void actionPerformed(ActionEvent e){ if(e.getSource()==b1){ String label=b1.getLabel(); if(b2.getLabel().equals("")){ b2.setLabel(label); b1.setLabel(""); } if(b4.getLabel().equals("")){ b4.setLabel(label); b1.setLabel(""); } } if(e.getSource()==b2){ String label=b2.getLabel(); if(b1.getLabel().equals("")){ b1.setLabel(label); b2.setLabel(""); } if(b3.getLabel().equals("")){ b3.setLabel(label); b2.setLabel(""); } if(b5.getLabel().equals("")){ b5.setLabel(label); b2.setLabel(""); } } if(e.getSource()==b3){ String label=b3.getLabel(); if(b2.getLabel().equals("")){ b2.setLabel(label); b3.setLabel(""); } if(b6.getLabel().equals("")){ b6.setLabel(label); b3.setLabel(""); } } if(e.getSource()==b4){ String label=b4.getLabel(); if(b1.getLabel().equals("")){ b1.setLabel(label); 4 b4.setLabel(""); } if(b7.getLabel().equals("")){ b7.setLabel(label); b4.setLabel(""); } if(b5.getLabel().equals("")){ b5.setLabel(label); b4.setLabel(""); } } if(e.getSource()==b5){ String label=b5.getLabel(); if(b2.getLabel().equals("")){ b2.setLabel(label); b5.setLabel(""); } if(b6.getLabel().equals("")){ b6.setLabel(label); b5.setLabel(""); } if(b4.getLabel().equals("")){ b4.setLabel(label); b5.setLabel(""); } if(b8.getLabel().equals("")){ b8.setLabel(label); b5.setLabel(""); } } if(e.getSource()==b6){ String label=b6.getLabel(); if(b9.getLabel().equals("")){ b9.setLabel(label); b6.setLabel(""); } if(b3.getLabel().equals("")){ b3.setLabel(label); b6.setLabel(""); } if(b5.getLabel().equals("")){ b5.setLabel(label); b6.setLabel(""); } } if(e.getSource()==b7){ String label=b7.getLabel(); if(b4.getLabel().equals("")){ b4.setLabel(label); b7.setLabel(""); } if(b8.getLabel().equals("")){ b8.setLabel(label); b7.setLabel(""); 5 } } if(e.getSource()==b8){ String label=b8.getLabel(); if(b9.getLabel().equals("")){ b9.setLabel(label); b8.setLabel(""); } if(b7.getLabel().equals("")){ b7.setLabel(label); b8.setLabel(""); } if(b5.getLabel().equals("")){ b5.setLabel(label); b8.setLabel(""); } } if(e.getSource()==b9){ String label=b9.getLabel(); if(b6.getLabel().equals("")){ b6.setLabel(label); b9.setLabel(""); } if(b8.getLabel().equals("")){ b8.setLabel(label); b9.setLabel(""); } } //congrats code if(b1.getLabel().equals("1")&&b2.getLabel().equals("2")&&b3.getLabel() .equals("3")&&b4.getLabel().equals("4")&&b5.getLabel().equals("5") &&b6.getLabel().equals("6")&&b7.getLabel().equals("7")&&b8.getLabel () .equals("8")&&b9.getLabel().equals("")){ JOptionPane.showMessageDialog(this,"Congratulations! You won."); } public static void main(String[] args) { new Puzzle(); } } 6 } 6.0 Actual Resources Used: Sr. No . 1. 2. 3. Specificatio ns Name of Resource/material Zenith Pc Computer System with broad specifications 2GB Ram Linux Mint/Win8.1 Operating System Office Software 4. Keyboard 5. Mouse Quantity 7 1 Remarks 7.0 Outputs of the Micro-Project: Start State: Puzzle Puzzle Goal State: 8 Win Puzzle Game: 8.0 Skill Developed/Learning Outcomes of this Micro- Project: ● ● ● ● ● ● ● ● ● Analyzing the problem Problem solving approach Planning Design skill Logical skill Programming Testing and Troubleshooting Presentation Report writing 9 9.0 Application of this Micro-Project: 1) The use of media in education and other professional fields. 2) Java can be used to create complete applications that may run on a single computer or be distributed among server and client in network. 3) java is used for web applications like a google documents. Teacher Signature (Mr. S. B. Jadhav) 10