adding cs142 code

This commit is contained in:
dm
2016-04-06 20:45:34 -07:00
parent 552d456d53
commit 8e52ce1982
174 changed files with 14064 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#include <string>
#include <iostream>
#include <cstdlib>
using namespace std;
#include "util.h"
const string usage = "usage: app <number of people> <step>";
int main(int argc, char * argv []) {
if(argc != 3) {
cerr << usage << endl;
return 1;
}
int number_of_people = atoi(argv[1]);
int step = atoi(argv[2]);
vector<bool> people(number_of_people, true);
vector<int> loosers = _play_game(people, step);
cout << loosers[loosers.size()-1] << endl;
return 0;
}