• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaScript Image Matcher

 
Ranch Hand
Posts: 122
C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,

I need help writing a program that looks like this:



At the beggining all the images are hidden, when a user clicks at one of the squares, the image beneath it opens, then the user gets to click another one, if the images are the same, they stay OPENED, otherwise they both get closed, and this goes on untill all the images stay opened.

Can you please give me an idea on what should I use to solve this, some tips on how to start cause this is my first time writing this kind of code.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kaspersky,
Have you started yet? In particular, the first step should be to draw the 4x4 grid with nothing showing. Then to be able to have a data structure (probably a 2D array) that randomly seeds the images and remembers what should happen when you click each box. Then to be able to click on any box and have the image show. Once all this works, is time to start with the logic you described.
 
reply
    Bookmark Topic Watch Topic
  • New Topic