Example #1
0
File: main.cpp Project: jorgeer/cpp
int main() {
	srand(time(0));
	int choice;
	cout << "skriv 1 for mastermind, alt annet for tester";
	cin >> choice;
	if (choice == 1) {
		playMastermind();
	}
	else {

		cout << "Noen tilfeldige tall fra 1 til 100:"<< endl;
		for (int i=0;i<10;i++) cout << randomWithLimits(1, 100) << " ";

		cout << endl << endl << "Noen tilfeldige bokstaver fra A til Z:" << endl;
		for (int i=0;i<10;i++) cout << randomCharWithLimits('A', 'Z') << " ";

		/* 2a
		v0 vil være 5, siden inkrementfunksjonen bare kopierer v0 ved kjøring.
		*/

		cout << endl << endl;
		testPart2();
		cout << endl << endl;
		testPart3();
		cout << endl << endl;
		testPart4();
	}

	return 0;
}
Example #2
0
int		main(int argc, char **argv, char **env)
{
	(void)argc;
	(void)argv;
	setvbuf(stdout, NULL, _IONBF, 0);
	testPart1();
	testPart2();
	testBonus();

	testPart3(env);
	return (0);
}
Example #3
0
int		main(int argc, char **argv, char **env)
{
	(void)argc;
	(void)argv;
	setvbuf(stdout, NULL, _IONBF, 0);
	if (argv[1] && !strcmp(argv[1], "1"))
		testPart1();
	if (argv[1] && !strcmp(argv[1], "2"))
		testPart2();
	if (argv[1] && !strcmp(argv[1], "3"))
		testPart3(env);

	return (0);
}