1 / 22

Paint-By-Numbers Puzzle

Paint-By-Numbers Puzzle. Chanwit Suebsureekul CS491B Spring 2006. Introduction. The black cells are hiding Find them! Use numbers as clues. The Rule. Each number represents the number of contiguous black cells, called a block There must be “ at least ” one space between blocks

lora
Download Presentation

Paint-By-Numbers Puzzle

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Paint-By-Numbers Puzzle Chanwit Suebsureekul CS491B Spring 2006

  2. Introduction • The black cells are hiding • Find them! • Use numbers as clues

  3. The Rule • Each number represents the number of contiguous black cells, called a block • There must be “at least” one space between blocks • The blocks are in the same sequenceas the numbers

  4. Motivation • Mario’s Picross • Can we make the computer think

  5. Objective • Puzzle Solver • Game • Puzzle Editor • Edit by numbers • Edit by painting

  6. Technology • J2SE 5.0 • Java Advanced Imaging (JAI) • Javagram

  7. JAI • Advance Image Processing Original 64x64 Resized 20x20 Grayscale Monochrome • Support standard image file formats • BMP, GIF, JPEG, PNG, TIFF, etc.

  8. Javagram • Created by Steven Simpson • Solve a puzzle one line at a time • LineSolver class • FastLineSolver • CompleteLineSolver

  9. FastLineSolver • Use the “Pushing Technique” • Push to the left • Push to the right • Look for the overlap

  10. FastLineSolver Example Push Push

  11. CompleteLineSolver • Try all possibilities • Look for the overlap

  12. CompleteLineSolver Example

  13. FastLineSolverVSCompleteLineSolver • FastLineSolver is much faster • CompleteLineSolver guarantees the best result

  14. Example FastLineSolver CompleteLineSolver

  15. Javagram Deficiency (1) • A conflict

  16. Javagram Deficiency (2) • Multiple solutions

  17. Javagram Deficiency (3) • Not enough clue

  18. Recursive Guessing Main Program Puzzle Javagram Recursive Guessing Solution

  19. Guessing Technique • Pick a random unsolved cell • Make a guess • Continue solving puzzle • If conflict, rollback and change the guessed cell (wrong guess) • If not conflict, find the solution (right guess) • Still have to rollback and try another path

  20. Why Recursive?

  21. Demo

  22. Summary • Paint by Numbers puzzle • JAI • Javagram • FastLineSolver • CompleteLineSolver • Recursive Guessing Technique

More Related