persistable sclass UpDownSequence is IntSize { new BitBuffer moves; // up is true *(S s) { for (c : characters(upper(s))) if (c == 'U') add(UpDown.up); else if (c == 'D') add(UpDown.down); } } void add(UpDown move) { moves.add(move.bit); } toString { ret join(countIterator moveChar(size())); } S moveChar(int i) { ret moves.get(i) ? "U" : "D"; } public int size() { ret moves.size(); } }