I just finished lesson 3 where it went over brief explanation of a function, how to call one, what it is to get you familiar with it but not to explain the whole 9 yards, which is in another lesson. After that happens once and get another set of 3 random numbers like '3 3 4', you get your 2 tokens and it doesn't take away the 3 like ti should work. It helps to use a version control system and commit every time code compiles and every time it works.
Compile, fix build errors and warnings, fix bugs at every step. }the bug is that when you execute the application and you type 'y' for your first set of random numbers and you get like '6 6 5' for example it will grant you your 2 tokens but then think that you lost and take away 3. Yeah, learning C can be tough, because it is so unforgiving in many ways. Lose(randomNumber, randomNumberTwo, randomNumberThree) Ĭout << 'Welcome to the most amazing text-based Slot Machine!' << endl Ĭout << 'Our fine Slot Machines are rigged so that you almost never win and so that we make BILLIONS of DOLLARS!' << endl Ĭout << 'Anyways, You have ' << tokens << 'tokens' << endl Ĭout << 'Soooo, have fun with these few tokens as you will have none left very, very, very SOON!' << endl įor(int playTime = 0 playTime<30001 playTime++) WinTwoTokens(randomNumber, randomNumberTwo, randomNumberThree) WinThreeTokens(randomNumber, randomNumberTwo, randomNumberThree) If(firstNumber=secondNumber=thirdNumber)Ĭout << 'Your numbers are:\t' << randomNumber << '\t' << randomNumberTwo << '\t' << randomNumberThree Int winThreeTokens(int firstNumber, int secondNumber, int thirdNumber)