Advertisement
Guest User

main.cpp

a guest
Oct 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. /* Copyright (c) 2018 Thomas Marshall
  2. University of Pretoria : U18007563 */
  3.  
  4. #include <iostream>
  5. #include <string>
  6. #include "encounterNode.h"
  7. #include "l_list.h"
  8.  
  9. int main() {
  10. int size = 4;
  11. std::string arr[] = {"Imp", "Cyber Demon", "Lost Soul", "Imp"};
  12. std::string rew = "Boots of Healing";
  13.  
  14. int size1 = 3;
  15. std::string arr1[] = {"Imp", "Mancubus", "Hell Knight"};
  16. std::string rew1 = "Sword of Death";
  17.  
  18. int size2 = 5;
  19. std::string arr2[] = {"Imp", "Mancubus", "Hell Knight", "Mancubus", "Your mom"};
  20. std::string rew2 = "Sword of Health Knights";
  21.  
  22. l_list* list = new l_list();
  23.  
  24. /* Add to front */
  25. list->addToFront(arr, size, rew);
  26. list->addToFront(arr1, size1, rew1);
  27. list->addToFront(arr2, size2, rew2);
  28.  
  29. /* Print full */
  30. std::cout << "PRINT LIST IN FULL\n===================\n";
  31. list->printList();
  32. std::cout << "\n";
  33.  
  34. list->addAtIndex(arr, size, rew2, 2);
  35.  
  36. /* Print full */
  37. std::cout << "PRINT LIST IN FULL\n===================\n";
  38. list->printList();
  39. std::cout << "\n";
  40.  
  41. /* Remove at index */
  42. std::cout << "REMOVE AT INDEX\n===================\n";
  43. list->removeFromIndex(0);
  44. list->printList();
  45. std::cout << "\n";
  46.  
  47. /* Delete list */
  48. std::cout << "DELETE LIST\n===================\n";
  49. delete list;
  50.  
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement