Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: create character listing

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112573] Re: create character listing
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Mon, 20 Sep 2010 05:44:30 -0400 (EDT)

Hi,

create a list of all tuples of length 3 from the set of characters
{"a",...,"z"} and then split this list at "bzz"

tuples = Tuples[CharacterRange["a", "z"], 3];
words = Map[StringJoin, tuples];
posOfbzz = First@Flatten[Position[words, "bzz"]];
TableForm[Take[words, posOfbzz]]

or as one-liner

Take[#, First@Flatten[Position[#, "bzz"]]] &@(StringJoin @@@ 
   Tuples[CharacterRange["a", "z"], 3])

Cheers
Patrick

On Sun, 2010-09-19 at 05:38 -0400, shippee wrote:
> What would be the best way to create a character/string listing of all
> values in columnar format from "aaa" through "bzz"?  I'd like to end
> up with something like:
> 
> aaa
> aab
> aac
> ...
> ...
> bzz
> 
> Thanks in advance, I've been away from Mathematica for a couple of
> years and forgotten almost everything I'd ever learned, so I'm
> starting over.  All I could find in searching this list was variations
> on the distribution of "abc", if I missed a more on point posting
> please point me in the right direction.
> 



  • Prev by Date: Re: How to run Mathematica nb file in command line in windows?
  • Next by Date: Re: create character listing
  • Previous by thread: Re: create character listing
  • Next by thread: Re: create character listing