Results 1 to 2 of 2

Thread: check a grid

  1. #1
    ethomas92 is offline Member
    Join Date
    Dec 2012
    Posts
    4
    Rep Power
    0

    Default check a grid

    I'm making som kind of game, it looks like a crossword puzzel.
    What is the best way to check every side of a square? I use swing to build up the grid.
    It also depends on if you fill in a word from left to right or from top to bottom because you don't need to check the squares in the direction you are typing a word. For now I have conditions for every case, but that's about 500 lines, it doesn't work.
    Instead of debugging it, there has to be an easier way. I think I need to look to John Conway's Game of Life.

    What do you guys think?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,691
    Rep Power
    8

    Default Re: check a grid

    I'm not totally sure what your question is, but I think the answer is going to depend entirely on what kinds of data structures you're using to store the grid. A 2D array seems to make sense, but you haven't indicated your approach, so it's hard to comment further.

    If you want better help, I suggest creating an SSCCE that demonstrates exactly what you're doing in as few lines as possible.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Grid help
    By lolmister in forum Java 2D
    Replies: 1
    Last Post: 05-24-2012, 05:35 AM
  2. Open Grid Scheduler/Grid Engine
    By java software in forum Java Software
    Replies: 0
    Last Post: 03-27-2012, 07:00 PM
  3. 2D grid
    By ranss41 in forum New To Java
    Replies: 0
    Last Post: 01-06-2012, 04:41 PM
  4. How can I square(^2) the pic in the grid
    By racewithferrari in forum New To Java
    Replies: 2
    Last Post: 11-03-2009, 05:27 PM
  5. How can I square(^2) the pic in the grid
    By racewithferrari in forum New To Java
    Replies: 1
    Last Post: 11-01-2009, 10:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •