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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
#include "header.h"
int main()
{
srand(time(0));
vector<string> birds(26);
//DISC 1
birds.at(0) = PlaySound(TEXT("disc1\\Track2\\1Northern Mocking Bird.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(1) = PlaySound(TEXT("disc1\\Track2\\2Brown Thrasher.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(2) = PlaySound(TEXT("disc1\\Track2\\3Cat Bird.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(3) = PlaySound(TEXT("disc1\\Track3\\1Downy Woodpecker.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(4) = PlaySound(TEXT("disc1\\Track3\\2Hairy Woodpecker.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(5) = PlaySound(TEXT("disc1\\Track3\\3Red Headed Woodpecker.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(6) = PlaySound(TEXT("disc1\\Track3\\4Red Bellied Woodpecker.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(7) = PlaySound(TEXT("disc1\\Track3\\5Northern Flicker.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(8) = PlaySound(TEXT("disc1\\Track3\\6Pileated Woodpecker.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(9) = PlaySound(TEXT("disc1\\Track4\\1American Robin.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(10) = PlaySound(TEXT("disc1\\Track4\\2Scarlet Tanager.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(11) = PlaySound(TEXT("disc1\\Track4\\3Summer Tanager.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(12) = PlaySound(TEXT("disc1\\Track4\\4Rose-breasted Grosbeak.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(13) = PlaySound(TEXT("disc1\\Track4\\5Red-eyed Virio.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(14) = PlaySound(TEXT("disc1\\Track4\\6Yellow-throated Virio.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(15) = PlaySound(TEXT("disc1\\Track5\\1Broad-winged Hawk.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(16) = PlaySound(TEXT("disc1\\Track5\\2Red-tailed Hawk.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(17) = PlaySound(TEXT("disc1\\Track5\\3Red-shouldered Hawk.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(18) = PlaySound(TEXT("disc1\\Track6\\1Swamp Sparrow.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(19) = PlaySound(TEXT("disc1\\Track6\\2Chipping Sparrow.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(20) = PlaySound(TEXT("disc1\\Track6\\Dark-eyed Junko.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(21) = PlaySound(TEXT("disc1\\Track6\\4Pine-warbler.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(22) = PlaySound(TEXT("disc1\\Track7\\1Cedar Waxwing.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(23) = PlaySound(TEXT("disc1\\Track7\\2Brown-headed Cowbird.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(24) = PlaySound(TEXT("disc1\\Track7\\3Eastern Kingbird.wav"),NULL,SND_FILENAME|SND_ASYNC);
birds.at(25) = PlaySound(TEXT("disc1\\Track7\\4European Starling.wav"),NULL,SND_FILENAME|SND_ASYNC);
vector<string> names(26);
names.at(0) = "Northern Mocking Bird";
names.at(1) = "Brown Thrasher";
names.at(2) = "Cat Bird";
names.at(3) = "Downy Woodpecker";
names.at(4) = "Hairy Woodpecker";
names.at(5) = "Red Headed Woodpecker";
names.at(6) = "Red Bellied Woodpecker";
names.at(7) = "Northern Flicker";
names.at(8) = "Pileated Woodpecker";
names.at(9) = "American Robin";
names.at(10) = "Scarlet Tanager";
names.at(11) = "Summer Tanager";
names.at(12) = "Rose-breasted Grosbeak";
names.at(13) = "Red-eyed Virio";
names.at(14) = "Yellow-throated Virio";
names.at(15) = "Broad-winged Hawk";
names.at(16) = "Red-tailed Hawk";
names.at(17) = "Red-shouldered Hawk";
names.at(18) = "Swamp Sparrow";
names.at(19) = "Chipping Sparrow";
names.at(20) = "Dark-eyed Junko";
names.at(21) = "Pine-warbler";
names.at(22) = "Cedar Waxwing";
names.at(23) = "Brown-headed Cowbird";
names.at(24) = "Eastern Kingbird";
names.at(25) = "European Starling";
int num = rand()%25;
bool go = true;
while(true)
{
//PlaySound(NULL,NULL,SND_FILENAME);
if(go)
num = rand()%25;
birds.at(num);
cout << num;
string enter;
getline(cin, enter);
if(enter == "0")
break;
if(enter.compare(names.at(num)) == 0) //.compare returns a 0 if they are equal
{
cout << "Correct";
go = true;
PlaySound(NULL, 0, 0); // Stop previous sound
//DEBUGGING
//If this next line is uncommented, then that file will
//play, but the vector files won't play
/*PlaySound(TEXT("disc1\\Track2\\1Northern Mocking Bird.wav"),NULL,SND_FILENAME|SND_ASYNC);*/
//DEBUGGING
}
else
{
cout << "Wrong";
go = false;
}
//cin.get(); // wait
system("pause");
//PlaySound(NULL, 0, 0);
/*int x;
cin >> x;
if(x == 0)
break;*/
}
return 0;
}
|