Hi all,

i was just wondering if anyone knows of any good sites that i could maybe get tutorials from to create wordsearches and crosswords?

any help would be great

sbmarsh

Dani AI

Generated

— good question; and thanks to @iamthwee for the pointer about structuring the code. Two quick context points before you start: Adobe officially ended Flash Player support, so new work should target HTML5/Canvas or migrate existing Flash with tools like CreateJS. See Adobe's notice and the Canvas docs for current browser-compatible approaches (Adobe Flash Player end-of-life, Canvas API — MDN, CreateJS).

Practical algorithm for wordsearches (common, fast approach): represent the board as a 2D array, sort the word list by length (longest first), then try random placements in allowed directions, checking for conflicts and matching letters. Use limited backtracking if a word cannot be placed. After all words are placed, fill empty cells with random letters. A compact pseudocode:

shuffle(words)
sort_by_length_desc(words)
for word in words:
  for tries in 0..N:
    pick random row,col,dir
    if fits_and_compatible(grid, word, row,col,dir):
      place_word(grid, word, row,col,dir)
      break
  if not placed: backtrack_or_expand_grid()
fill_empty_cells(grid)

Crossword generation is harder because every intersection must match. For full automatic generation look at exact-cover strategies (Algorithm X / Dancing Links) or use heuristic builders that seed a pattern and insert words greedily. See Algorithm X for the formal approach (Algorithm X — Wikipedia).

UI and engineering tips: place long words first, limit direction set to reduce failure rate, provide touch+mouse selection and keyboard accessibility, precompute puzzles server-side if generation is slow, and seed randomness to reproduce failing cases for debugging. If maintaining legacy Flash assets, export art and reimplement logic in Canvas/JS rather than rely on Flash Player in browsers.

Recommended Answers

All 2 Replies

Member Avatar for Member #46692

Designing these type of games in flash, I guess would be no different than doing the same in say java kiddo. So you need to have a good level of understanding of OOP possibly -mouseovers, 2d graphics etc.

In any case, I managed to find these links for the wordsearchs.
http://www.subtangent.com/maths/wordsearch.php

And the source.
http://www.subtangent.com/flash/

Well there ya go.

thx iamthwee,

that site will be a great help :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.