snoot.org message board: posting
re: letter generation rules
[17037] by "Tom 7" (h-64-105-108-15.phlapafg.covad.net)   on Wed 23 Oct 2002 09:57:00     [ reply ]
Here's the relevant code...

Basically it chooses 2 vowels, 1 'bad' letter, four 'good' letters, and the rest 'normal'. It always puts a q next to u.

#define LET_VOWELS "aaeeiou"
#define LET_GOOD "rstlnead"
#define LET_NORMAL "erteyuiopasdfgahlcbnm"
#define LET_BAD "qwygjkzxv"


void initboard(unsigned char * b) {
  string vw = stringutil::shuffle(LET_VOWELS);
  string go = stringutil::shuffle(LET_GOOD);
  string nm = stringutil::shuffle(LET_NORMAL LET_NORMAL);
  string bd = stringutil::shuffle(LET_BAD);

  /* always include two vowels,
     one bad letter,
     four good letters,
     the rest "normal"
  */
#define S(c) (stringutil::ctos(c))

  string board =
    stringutil::
    shuffle(S(vw[0]) + S(vw[1]) + S(bd[0]) + S(go[0]) +
            S(go[1]) + S(go[2]) + S(go[3]) + S(nm[0]) +
            S(nm[1]) + S(nm[2]) + S(nm[3]) + S(nm[4]) +
            S(nm[5]) + S(nm[6]) + S(nm[7]) + S(nm[8]));

#undef S(c)

  /* put U next to Q */
  ...

: post your reply here :

post as
subject


message