#!/bin/rc # solve NYT Spelling Bee rfork e fn e{echo $* >[1=2]; exit usage} if(! ~ $#* 7) e need seven arguments, centre letter first for(i in `{seq 7}) if(! ~ $$i [a-zA-Z]) e argument $i not a letter: $$i fn d{while(! ~ $#* 1){if(~ $1 $*(2-)) e duplicate arguments: $1; shift}}; d $* i = `{echo $*(2-) | tr -d ' '} grep -i '^['$i']*['$1']['$i']*$' /lib/words | grep '....'