forked from AlexCampbell/Risk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSorter.cpp
More file actions
37 lines (25 loc) · 677 Bytes
/
Sorter.cpp
File metadata and controls
37 lines (25 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <vector>
#include <algorithm>
#include "Sorter.h"
#include "battle.h"
Battle myBattle;
Sorter::Sorter() {
}
std::ostream& operator<< (std::ostream& out, int_vec& vec) {
for (int_iter iter = vec.begin(); iter != vec.end(); iter++)
out << " " << *iter;
return out;
}
int Sorter::asorter(std::vector<int>& arr, std::vector<int>& arr2) {
{
std::sort(arr.begin(), arr.end());
std::cout << " Atk Sorted: " << arr << std::endl;
}
{
std::sort(arr2.begin(), arr2.end());
std::cout << " Def Sorted: " << arr2 << std::endl;
}
int i = myBattle.Results(arr, arr2);
return i;
}