diff --git a/Picture matching game/default.jpg b/Picture matching game/default.jpg new file mode 100644 index 0000000..2f512d1 Binary files /dev/null and b/Picture matching game/default.jpg differ diff --git a/Picture matching game/match.class b/Picture matching game/match.class new file mode 100644 index 0000000..af6d507 Binary files /dev/null and b/Picture matching game/match.class differ diff --git a/Picture matching game/match.java b/Picture matching game/match.java new file mode 100644 index 0000000..5e34c4b --- /dev/null +++ b/Picture matching game/match.java @@ -0,0 +1,75 @@ +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; +public class match extends JFrame +{ + int i,click=0,scr=0; + String str="",strg="*"; + JButton[] icbutton=new JButton[8]; + JButton clkbutton; + String s[]={"s1.jpg","s3.jpg","s2.jpg","s4.jpg","s3.jpg","s2.jpg","s1.jpg","s4.jpg"}; + ImageIcon[] icons=new ImageIcon[8]; + ImageIcon img; + public match() + { + setLayout(new GridLayout(2,4)); + for(i=0;i=8)&&(click<=16)) + { + img=new ImageIcon("default.jpg"); + clkbutton.setIcon(img); + click++; + } + else + { + img=icons[j]; + clkbutton.setIcon(img); + click++; + if(click>16&&(click%2==0)) + { + strg=s[j]; + } + else + { + str=s[j]; + } + } + } + } + if(strg==str) + { + scr=scr+5; + System.out.println(scr); + } + } + } + public static void main(String args[]) + { + match g=new match(); + g.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + g.setVisible(true); + g.setSize(200,200); + g.setTitle("Find Match"); + } +} + + + + diff --git a/Picture matching game/s1.jpg b/Picture matching game/s1.jpg new file mode 100644 index 0000000..b3ea0dc Binary files /dev/null and b/Picture matching game/s1.jpg differ diff --git a/Picture matching game/s2.jpg b/Picture matching game/s2.jpg new file mode 100644 index 0000000..2ed9d75 Binary files /dev/null and b/Picture matching game/s2.jpg differ diff --git a/Picture matching game/s3.jpg b/Picture matching game/s3.jpg new file mode 100644 index 0000000..168661e Binary files /dev/null and b/Picture matching game/s3.jpg differ diff --git a/Picture matching game/s4.jpg b/Picture matching game/s4.jpg new file mode 100644 index 0000000..8fdf405 Binary files /dev/null and b/Picture matching game/s4.jpg differ