Quackey




Quackey is a software version of the classic Perquackey anagramming word game. It is implemented as a Bash shell script and runs under Linux, UNIX, and OSX. The game is suitable for either solitary or competitive play.

The Perquackey board game consists of a set of letter dice, a 3-minute sand timer, and specially-formatted score sheets ... all packaged in a brightly-colored tin. Although marketed as an educational game for children, many adults consider it to be on a par with Scrabble as an anagramming word-building game. Over the years, it has been distributed by Hollingsworth Brothers, Lakeside Industries, and Cardinal, among others. It is still available for purchase.

From a set of 10 (13 in vulnerable version) letters, the player forms anagrams, scored according to word length, and with category completion bonuses. There is a time limit on each play. The rules are (mostly) compatible with classic Perquackey.


Download URL

URL of the tarball.



Screenshot





Installation

The qky.sh script requires an ASCII UNIX-format word list file, one word per line, installed in /usr/share/dict. The name of the file must be word.list ...

A suggested list is the script author's yawl word list package.
(Mirror site)

To run the script, simply type: sh qky.sh Better yet, rename the qky.sh file to qky and make it directly executable by a chmod 755 qky and then copy it to the /usr/local/bin directory. After that simply typing qky in an xterm or Gnome terminal invokes the script.



News

Version 0.2:
Now part of this package is a qkyv.sh script that implements a vulnerable version of Quackey.

To run that script, simply type: sh qkyv.sh
... etc.


Version 0.3:
Fixed qkyv.sh for 9-letter word display.
Added qkyv2.sh, Same as qkyv.sh but with listing of all possible 7+ letter anagrams appended to auto-save file.


Version 0.4:
Added qbot.sh, a "bot" that automatically plays Quackey with any arbitrary letter set the player gives it.



History

My first contact with Perquackey was an article in a 1979 issue of Creative Computing. David E. Powers had written the game in Level II BASIC for the TRS-80 Model I. A few hours of typing in the listing and pressing <RUN/ENTER> gave me a black-and-white screen full of word columns that I anagrammed from a randomly generated letter set and the resultant scores. The program checked whether the input words were constructable and scored them accordingly. It was up to me, the player, to validate the words by looking them up in a paper dictionary.

The program was good enough to make me wish that . . . it were just a little better, perhaps with an automatic word validity check against an in-memory dictionary. But, at the time, my coding skills weren't quite up to the task.

Here's a sample of Powers' original code:

  2050 FOR LR=1 TO LP+3
  2060   T$=MID$(W$(LP,LQ),LR,1)
  2070   IN=INSTR(LX$,T$)
  2080   IF IN=0 THEN 2110
  2090   MID$(LX$,IN,1)=" "
  2100   GOTO 2130
  2110   F(LP,LQ)=1
  2120   ON LP+1 GOSUB 3840, 3860, 3880, 3900, 3920, 3940, 3960
  2230 NEXT LR


Whew! Makes you glad you have the option to code in Bash.

While Powers' program in a sense "inspired" me, I most certainly didn't port, translate, or even have it at hand when I wrote qky.sh. BASIC spaghetti code is pretty much useless as a template. Better to start fresh.

Compare the above snippet with an excerpt from qky.sh that, I suppose, accomplishes pretty much the same thing.

  while [ "$idx" -lt "$strlen" ]
  do
    is_found=$(expr index "${local_LS[*]}" "${local_word:idx:1}")
    if [ "$is_found" -eq "$NONCONS" ] # Not constructable!
    then
      echo "$FAILURE"; return
    else
      ((pos = ($is_found - 1) / 2))   # Compensate for spaces betw. letters!
      local_LS[pos]=$NULL             # Zero out used letters.
      ((idx++))                       # Bump index.
    fi
  done


While I can't claim to be anything resembling a virtuoso scripter, I'd say my code is somewhat of an improvement on the original. On the other hand, Mr. Powers has likely improved his own coding skills over the past three decades and could possibly run rings around me now. . . .