xxxxxxxxxx
95
// Copyright 2020 Gideon Goldin
// Word list from https://scrabble.merriam.com/2-letter-words
let padding = 20;
let x;
let y;
let words = [
["Aa: rough, cindery lava", "Ab: abdominal muscle", "Ad: advertisement", "Ae: one", "Ag: pertaining to agriculture", "Ah: expresses delight", "Ai: three-toed sloth", "Al: an East Indian tree", "Am: form of \"to be\"", "An: indefinite article", "Ar: the letter \"R\"", "As: to the same degree", "At: in the position of", "Aw: expresses protest", "Ax: cutting tool", "Ay: affirmative vote"],
["Ba: (Egyptian) eternal soul", "Be: to have actuality", "Bi: a bisexual", "Bo: a pal", "By: a side issue"],
["Da: dad (British)", "De: of; from - used in names", "Do: a tone of the scale"],
["Ed: pertaining to education", "Ef: the letter \"F\"", "Eh: expresses doubt", "El: elevated railroad", "Em: the letter \"M\"", "En: the letter \"N\"", "Er: expresses hesitation", "Es: the letter \"S\"", "Et: a past tense of eat", "Ew: esxpress disgust", "Ex: the letter \"X\""],
["Fa: a tone of the scale", "Fe: a Hebrew letter"],
["Gi: a garment worn in judo", "Go: to move along"],
["Ha: sound of surprise", "He: male person", "Hi: used as a greeting", "Hm: expresses consideration", "Ho: expresses surprise"],
["Id: part of the psyche", "If: a possibility", "In: to harvest", "Is: form of \"to be\"", "It: neuter pronoun"],
["Jo: sweetheart"],
["Ka: (Egyptian) spritual self", "Ki: inner strength, life energy"],
["La: tone of the scale", "Li: Chinese unit of distance", "Lo: expresses surprise"],
["Ma: mother", "Me: personal pronoun", "Mi: tone of the scale", "Mm: expresses assent", "Mo: a moment", "Mu: a Greek letter", "My: possessive pronoun"],
["Na: no; not", "Ne: born with the name of", "No: a negative reply", "Nu: a Greek letter"],
["Od: a hypothetical force", "Oe: Faeroe Islands whirlwind", "Of: coming from", "Oh: to exclaim in surprise", "Oi: express dismay (oy)", "Ok: all right", "Om: a mantra", "On: batsman's side of wicket", "Op: a style of abstract art", "Or: the heraldic color gold", "Os: a bone", "Ow: expresses pain", "Ox: a clumsy person", "Oy: expresses dismay"],
["Pa: father", "Pe: a Hebrew letter", "Pi: a Greek letter", "Po: a chamber pot"],
["Qi: circulating life energy"],
["Re: a tone of the scale"],
["Sh: urges silence", "Si: ti (a tone of the scale)", "So sol (a tone of the scale)"],
["Ta: expression of gratitude", "Te: a tone of the scale (ti)", "Ti: a tone of the scale", "To: in the direction of"],
["Uh: expresses hesitation", "Um: indicates hesitation", "Un: one", "Up: to raise", "Us: personal pronoun", "Ut: musical tone (is now DO)"],
["We: pronoun", "Wo: a woe"],
["Xia Greek letter", "Xu: monetary unity of Vietnam"],
["Ya: you", "Ye: you", "Yo: used to call attention"],
["Za: slang word for pizza"]
];
function setup() {
createCanvas(505, 400);
x = padding;
y = height - padding;
textAlign(CENTER);
stroke(255);
print(words);
}
function draw() {
background(0);
x = padding;
y = height - padding;
text("Two-Letter Scrabble Words", width/2, padding);
stroke(255);
line(x - padding/2, y - padding/2, width - padding/2, y - padding/2);
for(var i=0; i<words.length; i++) {
axis(words[i][0]);
for(var j=0; j<words[i].length; j++) {
word(words[i][j]);
}
newColumn();
}
}
function axis(str) {
fill(200);
noStroke();
text(str[0], x, height-padding/2);
}
function newColumn() {
x += padding;
y = height - padding;
}
function word(str) {
y -= padding;
if (mouseX > x - padding/2 && mouseX < x + padding/2 && mouseY > y - padding/1.5 && mouseY < y) {
noFill();
stroke(255);
rect(x - padding/2, y-padding/1.5, padding, padding);
fill(200);
noStroke();
text(str, width/2, padding*2);
}
fill(255);
noStroke();
text(str[1], x, y);
// text("*", x, y);
}