ANSWER TO EXERCISE 53 | |
Class Letter with list_together [; if (inventory_stage==1) { print "the letters "; if (~~(c_style & ENGLISH_BIT)) c_style = c_style + ENGLISH_BIT; if (~~(c_style & NOARTICLE_BIT)) c_style = c_style + NOARTICLE_BIT; if (c_style & NEWLINE_BIT) c_style = c_style - NEWLINE_BIT; if (c_style & INDENT_BIT) c_style = c_style - INDENT_BIT; } else print " from a Scrabble set"; ], short_name [; if (listing_together ofclass Letter) rfalse; print "letter ", (object) self, " from a Scrabble set"; rtrue; ], article "the";and then as many letters as desired, along the lines of Letter -> "X" with name "x"; |