Possibly a slightly "cleaner" way of coding this might be
Code:
program:
words=raw_field('#words');
shelf_name='Short Story';
shelf_name=cmp(words, 7500, shelf_name, 'Novelette', 'Novelette');
shelf_name=cmp(words, 17500, shelf_name, 'Novella', 'Novella');
shelf_name=cmp(words, 40000, shelf_name, 'Novel', 'Novel');
shelf_name=cmp(words, 50000, shelf_name, 'Long', 'Long');
shelf_name=cmp(words, 75000, shelf_name, 'Epic', 'Epic');
The major difference here is that all the calls to cmp are coded the same way;
shelf_name=cmp(word,
number, shelf_name, '
Name to Use', '
Name to Use');
where
number is the upper limit on the PREVIOUS book's length
and
Name to Use is the name to assign to books LONGER than
number words long.