cs162/assignments/assignment1/magic.cpp
/*********************************************************************
 * ** Function: sort_again
 * ** Description: This function prompts the user to choose which sorting option they want to do
 * ** Parameters: wizard *wiz, int wiz_index, int num_wizards, spellbook *spells, int num_books
 * ** Pre-Conditions: the user has logged in and is about to sort
 * ** Post-Conditions: user has selected an option 
 * *********************************************************************/
sort_again
Description: This function prompts the user to choose which sorting option they want to do
Parameters: wizard *wiz, int wiz_index, int num_wizards, spellbook *spells, int num_books
Pre-Conditions: the user has logged in and is about to sort
Post-Conditions: user has selected an option
sort_again Description : This function prompts the user to choose which sorting option they want to do Parameters : wizard * wiz int wiz_index int num_wizards spellbook * spells int num_books Pre - Conditions : the user has logged in and is about to sort Post - Conditions : user has selected an option
bool sort_again(wizard *wiz, int wiz_index, int num_wizards, spellbook *spells, int num_books) {
	int choice = choose();
	if(choice == 1) {
		page_sort(wiz, wiz_index, spells, num_books);
	}
	else if(choice == 2) {
		effect_sort(wiz, wiz_index, spells, num_books);
	}
	else if(choice == 3) {
		sr_sort(wiz, wiz_index, spells, num_books);
	}
	else {
		return false;
	}
	return true;
}
bool sort_again ( wizard * wiz , int wiz_index , int num_wizards , spellbook * spells , int num_books ) { int choice = choose ( ) ; if ( choice == 1 ) { page_sort ( wiz , wiz_index , spells , num_books ) ; } else if ( choice == 2 ) { effect_sort ( wiz , wiz_index , spells , num_books ) ; } else if ( choice == 3 ) { sr_sort ( wiz , wiz_index , spells , num_books ) ; } else { return false ; } return true ; }
** Function: sort_again
 ** Description: This function prompts the user to choose which sorting option they want to do
 ** Parameters: wizard *wiz, int wiz_index, int num_wizards, spellbook *spells, int num_books
 ** Pre-Conditions: the user has logged in and is about to sort
 ** Post-Conditions: user has selected an option
** Function : sort_again ** Description : This function prompts the user to choose which sorting option they want to do ** Parameters : wizard * wiz int wiz_index int num_wizards spellbook * spells int num_books ** Pre - Conditions : the user has logged in and is about to sort ** Post - Conditions : user has selected an option