All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Numbered Letters (Posted on 2003-07-17)
If each letter has a value (a=1, b=2, c=3 etc.) what words have a total letter value of exactly 100 when you add up all of the letters?

Are there any words that equal 100 if the letter values are swapped (z=1, y=2.....a=26)?

 See The Solution Submitted by Lewis Rating: 3.2857 (7 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 program for finding them | Comment 4 of 28 |
This program, given a word list (it's set up for bogwords.txt) finds matching words under each criterion:
```
OPEN "bogwords.txt" FOR INPUT AS #1

OPEN "wval100a.txt" FOR OUTPUT AS #2

OPEN "wval100b.txt" FOR OUTPUT AS #3

DO

LINE INPUT #1, w\$

w\$ = LCASE\$(w\$)

t1 = 0: t2 = 0

FOR i = 1 TO LEN(w\$)

v1 = ASC(MID\$(w\$, i, 1)) - ASC("a") + 1

v2 = 27 - v1

t1 = t1 + v1: t2 = t2 + v2

NEXT

IF t1 = 100 AND t2 = 100 THEN PRINT w\$

IF t1 = 100 THEN PRINT #2, w\$

IF t2 = 100 THEN PRINT #3, w\$

LOOP UNTIL EOF(1)

```

 Posted by Charlie on 2003-07-17 11:44:52

 Search: Search body:
Forums (0)