Programming Language Scrabble
We broke out Scrabble™ last night. While working through the permutations of my seven letters, I seemed to happen upon reserved words from various programming languages again and again.
Most programming languages have a set of these reserved words (a.k.a., keywords) that can't be used by the programmer for other things that need names (e.g., variables, functions, classes). To do so would confuse the computer, in much the same way as Bill Clinton's line "it depends on what the meaning of the word 'is' is," confused the grand jury.
I wondered if it would be possible to play Scrabble with just these reserved words. I also wondered if it would be possible to be any more of a computer geek than I already was.
The Internet teaches us that none of our ideas are original. Sure enough, someone else had already proposed such nerdlike Scrabble variations. But Geektronica, as this fellow is known -- apparently I do not reside atop the pinnacle of geekiness after all -- did not follow his proposal through to its ultimate, if insane, conclusion.
To begin, I looked up the ten most popular programming languages as of November 2007: Java, C, BASIC, C++, PHP, Perl, Python, C#, Ruby, and JavaScript. C and its descendants seemed over-represented, so I tossed a few oldies onto the pile: FORTRAN, COBOL, Pascal, Smalltalk, and Prolog. Sadly, Lisp and Forth don't really have reserved words.
I had once seen an offhand comparison of a language's reserved word count to its complexity, and if the two truly are inversely proportional then we should all be programming in Smalltalk (if not Lisp and Forth):
(Different versions and implementations of languages have different numbers of reserved words. I just snagged the first count I could find. The chart was prepared with a nifty online tool -- for kids.)
I then aggregated the lists of the fifteen languages' reserved words, throwing out digits and punctuation marks, to arrive at a Scrabble-riffic list of 958 unique reserved words.
I didn't bother excluding words that couldn't possibly be formed with the game's letter distribution (even with the blank tiles). There are also a few one-letter reserved words, which I believe can only be played on the first move of Scrabble: watch your opponents' faces as you kick off a new game with "q" (from Perl).
It's going to chew up a lot of RSS bandwidth, but I know someone will want the complete list:
abs, abstract, accept, access, add, address, advancing, after, alarm, alfa, alias, align, all, allowing, alphabet, alphabetic, alphabeticlower, alphabeticupper, alphanumeric, alphanumericedited, also, alter, alternate, and, andthen, answer, any, apply, are, area, areas, argc, argv, arithmetic, array, as, asc, ascending, ask, asm, assert, assign, at, atan, atn, author, auto, automatic, backspace, band, base, basis, beep, before, begin, beginning, bexor, binary, bind, binmode, bit, bits, blank, bless, bload, block, blockdata, bnot, bool, boolean, bor, bottom, break, bsave, by, byte, call, caller, cancel, cardinal, case, catch, cbl, cd, cdbl, cf, cfunction, ch, chain, char, character, characters, chdir, checked, chmod, chomp, choose, chop, chown, chr, chroot, cint, circle, class, classid, clear, clockunits, close, closedir, cls, cobol, code, codeset, collating, color, column, com, comma, commit, common, communication, comp, complex, computational, compute, comreg, configuration, connect, const, cont, contained, contains, content, continue, control, controls, converting, copy, corr, corresponding, cos, count, crypt, csng, csrlin, currency, current, cvd, cvi, cvs, cycle, data, date, datecompiled, datewritten, day, dayofweek, db, dbaccesscontrolkey, dbcs, dbdataname, dbexception, dbmclose, dbmopen, dbrecordname, dbsetname, dbstatus, de, debugcontents, debugger, debugging, debugitem, debugline, debugname, debugsub, decimal, decimalpoint, declaratives, declare, decode, def, default, defdbl, defined, definefile, defint, defsng, defstr, del, delegate, delete, delimited, delimiter, depending, descending, destination, detail, die, dim, dimension, directory, disable, disconnect, display, div, divide, division, do, doapplescript, donwto, double, doublecomplex, doubleprecision, down, draw, dump, duplicate, duplicates, dynamic, each, eall, echo, edit, eerror, egcs, egi, eject, elif, else, elseif, elsif, emi, empty, enable, encode, end, endadd, endcall, endcompute, enddeclare, enddelete, enddisable, enddivide, enddo, endenable, endevaluate, endfile, endfor, endforeach, endgrent, endhostent, endif, ending, endinvoke, endmap, endmultiply, endnetent, endofpage, endperform, endprotoent, endpwent, endread, endreceive, endreturn, endrewrite, endsearch, endsend, endstart, endstring, endstructure, endsubtract, endswitch, endtransceive, endunion, endunstring, endwhile, endwrite, ensure, enter, entry, enum, environ, environment, eof, eop, eparse, equal, equals, equivalence, eqv, erase, erdev, erl, err, error, esi, eval, evaluate, event, every, ewarning, exact, exceeds, except, exception, exclusive, exec, exists, exit, exp, explicit, export, extend, extends, extern, external, faccess, false, fcntl, fd, fetch, field, file, filecontrol, fileno, files, filler, final, finally, find, finish, first, fix, fixed, float, flock, footing, for, foreach, fork, form, format, formline, fortran, forward, fre, free, friend, from, function, generate, get, getc, getfileinfo, getgrent, getgrgid, getgrnam, gethostbyaddr, gethostbyname, gethostent, getlogin, getnetbyaddr, getnetbyname, getnetent, getpeername, getpgrp, getppid, getpriority, getprotobyname, getprotobynumber, getprotoent, getpwent, getpwnam, getpwuid, getservbyaddr, getservbyname, getservbyport, getservent, getsockname, getsockopt, giving, glob, global, globaldef, globalvalue, gmtime, go, goback, gosub, goto, greater, grep, group, heading, hex, highvalue, highvalues, hostname, httpcookievars, httpenvvars, httpgetvars, httppostfiles, httppostvars, httpservervars, id, identification, if, imp, implements, implicit, implicitnone, implicitundefined, import, in, include, includeonce, index, indexed, indicate, inherits, initial, initialize, initiate, inkey, inline, inp, input, inputoutput, inquire, insert, inspect, installation, instanceof, instr, int, integer, integeraddress, inter, interface, internal, into, intrinsic, intset, invalid, invoke, io, iocontrol, ioctl, is, join, just, justified, kanji, keep, key, keys, kill, label, lambda, last, lc, lcfirst, ld, leading, left, len, length, less, let, limit, limits, linage, linagecounter, line, linecounter, lines, link, linkage, list, listen, llist, load, loadexternals, loc, local, locally, localstorage, localtime, locate, lock, lof, log, logical, long, lowvalue, lowvalues, lpos, lprint, lset, lstat, m, makefsspec, makepath, map, member, memory, merge, message, metaclass, method, methodid, mid, mkd, mkdir, mki, mks, mod, mode, modify, module, modules, morelabels, motor, move, msgctl, msgget, msgrcv, msgsnd, multiple, multiply, my, name, namelist, namespace, native, negative, new, next, nil, no, none, normal, noshare, nospanblocks, not, null, nulls, number, numeric, numericedited, object, objectcomputer, occurs, oct, of, off, oldfunction, omitted, on, only, open, opendir, operator, option, optional, options, or, ord, order, orelse, organization, other, otherwise, out, output, overflow, override, owner, pack, package, packed, packeddecimal, padding, page, pagecounter, paint, paragraph, parameter, params, parent, pass, password, pause, peek, pen, perform, pf, ph, phpos, phpself, phpversion, pic, pick, picture, pipe, play, plus, pmap, point, pointer, poke, pop, pos, position, positive, present, preset, previous, print, printf, printing, prior, private, procedure, procedurepointer, procedures, proceed, processing, program, programid, protected, pset, public, purge, push, put, pwd, q, qq, quadruple, queue, quit, quote, quotemeta, quotes, qw, qx, raise, rand, random, randomize, rd, read, readdir, readlink, readonly, ready, real, realm, receive, reconnect, record, recording, recordname, records, recursive, recv, redefines, redo, reel, ref, reference, references, register, relation, relative, release, reload, rem, remainder, removal, rename, renames, renum, repeat, repeated, replace, replacing, reply, report, reporting, reports, repository, require, requireonce, rerun, rescue, reserve, reset, restore, resume, retaining, retrieval, retry, return, returncode, returning, reverse, reversed, rewind, rewinddir, rewrite, rf, rh, right, rindex, rmdir, rnd, rollback, rounded, rset, run, s, same, save, sbyte, scalar, screen, sd, sealed, search, section, security, seek, seekdir, segment, segmentlimit, select, self, semctl, semget, semop, send, sentence, separate, sequence, sequential, service, sessionid, set, setfileinfo, setgrent, sethostent, setnetent, setpgrp, setpriority, setprotoent, setpwent, setservent, setsockopt, sgn, shared, shell, shift, shiftin, shiftout, shmctl, shmget, shmread, shmwrite, short, shutdown, sign, signed, sin, single, size, sizeof, skip, sleep, socket, socketpair, sort, sortcontrol, sortcoresize, sortfilesize, sortmerge, sortmessage, sortmodesize, sortreturn, sound, source, sourcecomputer, space, spaces, spc, specialnames, splice, split, sprintf, sqr, sqrt, srand, stackalloc, standard, start, stat, static, status, stdclass, step, stick, stop, store, str, strictfp, strig, string, struct, structure, stty, study, sub, subqueue, subroutine, subschema, substr, subtract, sum, super, suppress, swap, switch, symbolic, symlink, sync, synchronized, syscall, sysopen, sysread, system, syswrite, tab, table, tally, tallying, tan, tape, tell, telldir, template, tenant, terminal, terminate, test, text, than, then, this, thiscontext, through, throw, throws, thru, tie, tied, time, timeout, timer, times, timestamp, title, to, top, tr, trace, trailing, transceive, transient, troff, tron, true, truncate, try, type, typedef, typeof, uc, ucfirst, uint, ulong, umask, unchecked, undef, undefined, unequal, union, unit, univptr, unless, unlink, unlock, unpack, unsafe, unshift, unsigned, unstring, untie, until, up, update, upon, usage, usagemode, use, ushort, using, usr, utime, val, valid, validate, value, values, var, variantstruct, variantunion, varptr, varying, vec, view, virtual, void, volatile, volumes, wait, waitpid, wakeup, wantarray, warn, wend, when, whencompiled, while, width, window, with, within, words, workingstorage, write, writeonly, xor, y, yield, zero, zeroes, zeros.
For added challenge, see if you can't form both of COBOL's spellings of the plural of "zero."
Comments