I'm writing a crossword solving program, and want an equation that will tell me how many possible strings I need to check from a box of h height and w width.
For example, if given the box:
abc
def
Im looking for the strings (a, b, c, ab, bc, cb, ba, abc, bca, d, e, f, de, ef, fe, ed, ad, da, be, eb, cf, fc). I can't figure out a general equation that will tell me how many strings there are for any W x H box.
Any help is appreciated, thanks.