int serve_level(string riddle, string answer, string allowable_chars) { bool correct_answer = false; int player_input_1; char player_input_2; LList<char> l; cout << riddle << endl; while(!correct_answer) { player_input_1 = 0; cout << "Available letters: " << allowable_chars << endl; cout << "Choose something to do to the list: " << endl; cout << "[1] to Append a letter to the back of the list. " << endl; cout << "[2] to Push a letter to the front of the list. " << endl; cout << "[3] to Delete a letter from the list. " << endl; cout << "The list will be printed out each time you modify it. " <<endl; cin >> player_input_1; if(player_input_1 == 1) { cout << "Select a letter to append. " << endl; cin >> player_input_2; if(allowable_chars.find(player_input_2) != string::npos) { l.append(player_input_2); cout << player_input_2 << " appended to the list! " << endl; l.print(); } else { cout << "Please use a valid letter! "; } } else if(player_input_1 == 2) {
void enqueue(const E it) { queue->append(it); ++length; }