Assign the values of 1 through 26 respectively to A through Z.
Find words of x letters (all letters and words
1 different) such that the sum of letter values becomes the word value that fits each table category.
The table values represent the best values, being the lowest and highest, for which I was able; the left column represents word length. Can you also do better by providing a word lower or higher than the table value?
The blank cells are for those who wish to press this further.
| | | | | | | | | |
| | | | | | | | | |
| | | Prime | Triangle | Square | |
| | | Lowest | Highest | Lowest | Highest | Lowest | Highest | |
| | 3 | 7 | 61 | 6 | 66 | 9 | 64 | |
| | 4 | 13 | 79 | 15 | 78 | 16 | 64 | |
| | 5 | 19 | 89 | 21 | 91 | 36 | 81 | |
| | 6 | 37 | 109 | 36 | 91 | 49 | 100 | |
| | 7 | 47 | 97 | 66 | 78 | 81 | 100 | |
| | 8 | | | | | | | |
| | 9 | | | | | | | |
| | | | | | | | | |
1Special note: Should a word score 36 (being both a triangle and square) neither a repetition of it nor any anagrams is considered acceptable.
DECLARE FUNCTION numVal! (w$)
DIM lowPrime$(3 TO 26), highPrime$(3 TO 26)
DIM lowTriangle$(3 TO 26), highTriangle$(3 TO 26)
DIM lowSquare$(3 TO 26), highSquare$(3 TO 26)
DIM lowP(3 TO 26), highP(3 TO 26)
DIM lowT(3 TO 26), highT(3 TO 26)
DIM lowS(3 TO 26), highS(3 TO 26)
FOR i = 3 TO 26
lowP(i) = 99999
lowT(i) = 99999
lowS(i) = 99999
NEXT
OPEN "wordswords.txt" FOR INPUT AS #1
DO
LINE INPUT #1, w$
w$ = LTRIM$(RTRIM$(w$))
IF LCASE$(w$) = w$ AND LEN(w$) > 2 THEN
v = numVal(w$): l = LEN(w$)
IF l = 3 AND v = 64 THEN PRINT w$
' above line to find alternative to oxy
isPrime = 0: isTri = 0: isSqu = 0
OPEN "primes.txt" FOR INPUT AS #10
DO
INPUT #10, pr
IF v = pr THEN isPrime = 1: EXIT DO
LOOP UNTIL EOF(10) OR pr > v
CLOSE 10
sr = INT(SQR(1 + 8 * v) + .5)
IF sr * sr = 1 + 8 * v THEN isTri = 1
sr = INT(SQR(v) + .5)
IF sr * sr = v THEN isSqu = 1
IF isPrime THEN
IF v < lowP(l) THEN lowP(l) = v: lowPrime$(l) = w$
IF v > highP(l) THEN highP(l) = v: highPrime$(l) = w$
END IF
IF isTri THEN
IF v < lowT(l) THEN lowT(l) = v: lowTriangle$(l) = w$
IF v > highT(l) THEN highT(l) = v: highTriangle$(l) = w$
END IF
IF isSqu THEN
IF v < lowS(l) THEN lowS(l) = v: lowSquare$(l) = w$
IF v > highS(l) THEN highS(l) = v: highSquare$(l) = w$
END IF
END IF
LOOP UNTIL EOF(1)
CLOSE 1
FOR i = 3 TO 26
IF lowP(i) < 99999 OR highP(i) > 2 OR lowT(i) < 99999 OR highT(i) > 2 OR lowS(i) < 99999 OR highS(i) > 2 THEN
PRINT USING "####"; i; lowP(i); highP(i); : PRINT " ";
PRINT USING "####"; i; lowT(i); highT(i); : PRINT " ";
PRINT USING "####"; i; lowS(i); highS(i); : PRINT " ";
END IF
PRINT
NEXT
OPEN "numerlgy.txt" FOR OUTPUT AS #2
FOR i = 3 TO 26
IF lowP(i) < 99999 OR highP(i) > 2 OR lowT(i) < 99999 OR highT(i) > 2 OR lowS(i) < 99999 OR highS(i) > 2 THEN
IF lowPrime$(i) > "" THEN PRINT #2, lowPrime$(i); " "; : ELSE PRINT #2, " . ";
IF highPrime$(i) > "" THEN PRINT #2, highPrime$(i); " "; : ELSE PRINT #2, " . ";
IF lowTriangle$(i) > "" THEN PRINT #2, lowTriangle$(i); " "; : ELSE PRINT #2, " . ";
IF highTriangle$(i) > "" THEN PRINT #2, highTriangle$(i); " "; : ELSE PRINT #2, " . ";
IF lowSquare$(i) > "" THEN PRINT #2, lowSquare$(i); " "; : ELSE PRINT #2, " . ";
IF highSquare$(i) > "" THEN PRINT #2, highSquare$(i); " "; : ELSE PRINT #2, " . ";
PRINT #2,
END IF
NEXT
END
FUNCTION numVal (w$)
t = 0
FOR i = 1 TO LEN(w$)
t = t + INSTR("abcdefghijklmnopqrstuvwxyz", MID$(w$, i, 1))
NEXT
numVal = t
END FUNCTION
bad tut cab wry aba oxy
aced putz abba onyx alba oozy
baaed wussy bacca fusty abaci nutty
cabbed syzygy baccae scuzzy abided luxury
addable zyzzyva cabbage bowwows acceded extorts
academia quixotry abapical surtouts cabbaged outports
beachhead torturous bacchanal susurrous abdicated outstunts
deadheaded outthrusts accidences outsprints bacchanals mutinously
deacidified luxuriously bacchanalia myxoviruses backpedaled murmurously
abracadabras prosperously amphibrachic prostitutors decalcomania prostitution
dieffenbachia expostulatory beneficiaries southwesterly adiabatically counterstyles
bibliomaniacal presumptuously boneheadedness contortionists cleanabilities overscrupulous
mechanochemical luxuriousnesses affordabilities constructivists
accessibilities supersymmetries
deacidifications voluptuousnesses accidentalnesses counterterrorism
boneheadednesses anthropomorphist
ineradicabilities counterterrorists exchangeabilities immunosuppressant
bacteriologically illustriousnesses
biodegradabilities unscrupulousnesses establishmentarian counterstrategists
disagreeablenesses expressionlessness
angiocardiographies structurelessnesses comprehensibilities diethylstilbestrols
circumstantialities dimethyltryptamines
radiopharmaceuticals counterdemonstrators electrocardiographic immunohistochemistry
electroencephalogram countersurveillances
electrocardiographies undemonstrativenesses establishmentarianism immunocytochemistries
unconstitutionalities unconstitutionalities
encephalomyocarditises otorhinolaryngologists nonrepresentationalism reinstitutionalization
microspectrophotometer microspectrophotometer
indistinguishablenesses hexamethylenetetramines . . . .
dichlorodifluoromethanes microspectrophotometries intercomprehensibilities intercomprehensibilities . .
An added line from the program shows an alternate for oxy is sty, as oxy is really only a prefix.
The stats are:
3 7 61 3 6 66 3 4 64
4 13 83 4 6 78 4 16 81
5 13 107 5 10 91 5 16 100
6 17 127 6 15 120 6 25 121
7 29 151 7 21 120 7 25 121
8 37 149 8 45 153 8 25 144
9 37 167 9 45 171 9 49 169
10 41 181 10 66 171 10 64 169
11 59 197 11 55 190 11 64 196
12 71 199 12 91 210 12 81 196
13 73 211 13 105 210 13 100 196
14 103 241 14 120 210 14 121 225
15 113 241 15 136 231 15 144 225
16 131 263 16 153 231 16 144 225
17 149 257 17 153 253 17 169 256
18 151 281 18 190 253 18 169 256
19 179 281 19 210 253 19 225 256
20 197 277 20 190 276 20 196 256
21 211 281 21 231 276 21 289 289
22 239 307 22 276 300 22 289 289
23 263 269 23 --- --- 23 --- ---
24 269 317 24 276 276 24 --- ---
Edited on February 28, 2009, 3:53 pm
Edited on February 28, 2009, 3:56 pm
|
Posted by Charlie
on 2009-02-28 15:52:40 |