[ANN] Ag 2.1 -- a scriptable anagram generator

17 views
Skip to first unread message

Andrew Trevorrow

unread,
May 2, 2026, 9:23:03 PM (11 hours ago) May 2
to lu...@googlegroups.com
Ag is a fast, scriptable anagram generator with a statically embedded
Lua interpreter (now 5.5.0). Ag is free, open source and runs on
Windows, macOS and Linux. There's also a command line version
called agc (also scriptable). Download link and screenshots here:

https://ag1.sourceforge.net/

Ag is not only good at finding anagrams. It has powerful pattern
matching features with a syntax that is (IMHO) a lot more readable
than regex or LPEG or Lua's native syntax.

For example, let's say you're playing Scrabble and your rack contains
a blank and these 6 letters: AAERSU. The following pattern will find
all 5 to 7-letter words using those tiles that start or end with A:

?5-7 & {aaersu?} & (a* | *a)

Or maybe you're playing Wordle and want to find all 5-letter words
with an A in the middle and W somewhere else but no N, D or T.
Use this pattern:

??A?? & *W* & [!NDT]5

Note that spaces are ignored and letter case doesn't matter when
entering text or patterns. The syntax is described here:
https://ag1.sourceforge.net/Help/patterns.html

Other key features:

* All Lua functions that take a file path (dofile, io.open, etc)
support UTF-8 paths on Windows, thanks to Peter Wu's patch:
https://github.com/Lekensteyn/lua-unicode

* The agc command handles UTF-8 strings in a Windows console.
You can enter a command like "agc -l French.lex œuvré" and see
the correct output (assuming the code page has been set to UTF-8
by running "chcp 65001").

Some of the supplied scripts:

* escape-codes.lua illustrates the ANSI escape sequences supported
by Ag's console window. Here's what it looks like on Linux:
https://ag1.sourceforge.net/ag-console-linux.png

* wordle.lua is a simple version of Josh Wardle's Wordle game.
Less than 100 lines of code, but it lets you play with any of the
supplied lexicons (English, French, German, Italian, Spanish, etc),
including the numeric lexicons. See some games using agc on macOS:
https://ag1.sourceforge.net/agc-wordle.png

Finally, a simplified version of Ag is now available for the iPad.
I recently ported Ag's C++ code to pure Lua so that it runs in
Glui, my free iPad app that runs Lua scripts. Just use Glui's
Download button and click the Anagrams link.

Andrew Trevorrow (aka OVERT WORD WARREN)
Reply all
Reply to author
Forward
0 new messages