I've been watching an rewatching this series to get a better grasp on the basics of C# and just wanted to say that you're course has been a huge, huge help. I'd have to say it's the best course on C# for beginners that I've found on KZbin, Skillshare, Udemy or any other site. Thanks so much for putting these videos up! :)
@upcom1ng1163 жыл бұрын
I was so willing to pay for the basic course and look through entire list of Udemy and couldn't really find anything decent and funny enough I found his channel and it's FREE!
@pulcifyfn29195 жыл бұрын
literally love you, helped me finish my game when i was stuck
@jasonatkinson25495 жыл бұрын
Hey Mike! I'm loving the tutorials, thank you! I took your idea from this tutorial and played with it a little bit. I figure you're too busy to check it out but I just wanted to say thanks for the hard work... you're definitely making a difference.
@scottisitt4 жыл бұрын
Great video! Easy to follow. Thanks, Mike!
@joyride93535 жыл бұрын
Hello Mike. I noticed a difference in the code for this video and what is on your website. while(!guess == secretWord && !outOfGuesses) Is what the website shows, but brings back an error. while(guess != secretWord && !outOfGuesses) works correctly and is what is shown in the video. Thank you for your tutorials. I am a beginner and these videos are extremely helpful.
@saadalsabagh48623 жыл бұрын
Thank you so much Alex for pointing out this errors. I spent a lot of time to figure this out. Thank you Mike for this great tutorial!
@AnimeRPG13 жыл бұрын
Added an array ( 03:11 ) to account for lower and uppercase (1st letter only): static void Main(string[] args) { //LESSON 17 Console.WriteLine("LESSON 17"); Console.WriteLine(""); string[] secretWord = new string [2]; secretWord[0] = "Author"; secretWord[1] = "author"; string guessWord = ""; { } while (guessWord != secretWord[0] && guessWord != secretWord[1]) { Console.Write("Enter a guess for the secret word: "); guessWord = Console.ReadLine(); } Console.WriteLine("You Win!"); Console.ReadLine(); }
@ShadesGameSource4 жыл бұрын
I managed to write the code below using a do while loop. I'm also reading a textbook on C# as I go through your videos, so I was able to incorporate a couple of things that haven't been mentioned in your videos (so far). =) string answer = "giraffe"; string guess = ""; int guessCounter = 5; do { Console.WriteLine("You have {0} guesses left.", guessCounter); Console.WriteLine("What is the most powerful animal in the universe?"); guess = Console.ReadLine(); Console.Write(" "); //noob line break implementation! guessCounter -= 1; } while (guess != answer && guessCounter > 0); if (guess == answer) { Console.WriteLine(" You won!~"); } else { Console.WriteLine(" You died!"); } Console.ReadLine();
@jaykhamankar87823 жыл бұрын
Can u tell me the name of book??
@AnimeRPG13 жыл бұрын
12:36 Final product using an Array: static void Main(string[] args) { //LESSON 17 Console.WriteLine("LESSON 17"); Console.WriteLine(""); string[] secretWord = new string [2]; //Use an array to account for Author or author being typed. secretWord[0] = "Author"; secretWord[1] = "author"; string guessWord = ""; int guessCount = 0; int guessLimit = 3; bool outOfGuesses = false; { } while (guessWord != secretWord[0] && guessWord != secretWord[1] && !outOfGuesses) { if (guessCount < guessLimit) { Console.Write("Enter a guess for the secret word: "); guessWord = Console.ReadLine(); guessCount++; } else { outOfGuesses = true; } } if (outOfGuesses) { Console.WriteLine("You lose! You ran out of guesses."); } else { Console.WriteLine("You Win!"); } Console.ReadLine(); }
@azorailke60572 жыл бұрын
I went ahead and added a counter like this : int guessRemaining = guessLimit - guessCount; Console.Write("You have " + guessRemaining + " guess(es) remaining. Guess the secret word: "); guess = Console.ReadLine(); guessCount++; It worked out well! 😺 I even let the user input how many guesses they wanted and did not let them specify a negative number or over 10. The code for that part looks messy though.
@DelphicRachel2 жыл бұрын
I benefitted a lot from this course, but there's just one thing I was wondering; how do you create a guessing game where the program selects a random string variable from an array, and then sets that as the word that you have to guess? Thanks so much for this amazing tutorial :)
@flourishajiboye7062 жыл бұрын
I have a little question In the code, your put the guessLimit at 3 meaning that you only want the user to answer 3 times. But under the while loop in the if statement you put the condition as (guessCount < guessLimit). guessCount keeps incrementing it self, and well I don't know how to say this but I'll try, i expected that the comdition would be (guessCount
@simplyjemelah82763 жыл бұрын
hi do you have a word guessing game with ArrayList and StringBuilder example?
@thecatch4648 Жыл бұрын
To make the user input case-insensitive you can use '.ToLower()' Like this "guess = Console.ReadLine().ToLower();"
@MyMrdouchebag4 жыл бұрын
how do you make it where from the console player 1 enters a random word then player 2 guesses what it is?
@Matstarx254 жыл бұрын
Theres a problem with the game though. It's lacking an if-statement before the loop begins. Because if you get the word correct in 1st try, you are still prompted to guess again untill you hit 3/3 guesses.
@AnimeRPG13 жыл бұрын
Didn't do that for me: static void Main(string[] args) { //LESSON 17 Console.WriteLine("LESSON 17"); Console.WriteLine(""); string[] secretWord = new string [2]; //Use an array to acount for Author or author being typed. secretWord[0] = "Author"; secretWord[1] = "author"; string guessWord = ""; int guessCount = 0; int guessLimit = 3; bool outOfGuesses = false; { } while (guessWord != secretWord[0] && guessWord != secretWord[1] && !outOfGuesses) { if (guessCount < guessLimit) { Console.Write("Enter a guess for the secret word: "); guessWord = Console.ReadLine(); guessCount++; } else { outOfGuesses = true; } } if (outOfGuesses) { Console.WriteLine("You lose! You ran out of guesses."); } else { Console.WriteLine("You Win!"); } Console.ReadLine(); }
@gn264224586 жыл бұрын
Just a beginner, isn't this code cleaner? // MY CODE using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Giraffe1 { class Program { static void Main(string[] args){ int count = 0; do { string secretWord = "apple"; Console.WriteLine("Yo what should be the secret word?"); string answer = Console.ReadLine(); count++; if (secretWord == answer) { Console.WriteLine("you're right!"); break; } } while (count < 3); Console.ReadLine(); } } } // MY CODE
@ROYALGAMERJAMES5 жыл бұрын
yeah but this video is not about just making the game its about to leaning to coding by these commands etc........
@axyegaming61284 жыл бұрын
Your code is cleaner even mine is the cleanest but he is trying to summarize previous lessons in one video
@johndoe-z6p6 ай бұрын
bool is used
@tehminashehryar78022 жыл бұрын
You can watch a very simple tutorial to develop puzzle game in C# for beginners at kzbin.info/aero/PLHGJljNavL-PZ6P7w1IhZAZhZPp-9f_2L
@AITakesYourJob3 жыл бұрын
Tried to do "do" loop. I'm newbie, but it kinda worked. string secretword = "ass"; string guess = ""; int tries = 0; bool outoftries = false; do { if (tries < 3) { Console.WriteLine("Your guess: "); guess = Console.ReadLine(); tries++; } else { outoftries = true; } } while (guess != secretword && !outoftries); if (outoftries) { Console.WriteLine("You failed"); } if (guess == secretword) { Console.WriteLine("You won!"); }
@AITakesYourJob3 жыл бұрын
here from next tutorial, also tried to create this game using "for" loop, but i have no idea if i did it right, it just works. string secretword = "ass"; string guess = ""; int tries; for (tries = 0; tries < 3; tries++) { Console.WriteLine("Your guess: "); guess = Console.ReadLine(); if (secretword == guess) { Console.WriteLine("You won"); break; } } if (tries == 3) { Console.WriteLine("You failed"); }
@W711-t7x4 жыл бұрын
Can't you just use a simple break; instead of !outOfGuesses?
@upcom1ng1163 жыл бұрын
You can use break; with if and else condition but not in parameter. Nature of while condition is Boolean only.
@darthvader444 жыл бұрын
Hello sir i created this game with do wile loop string word = "adi"; string ans=""; int guess= 0; int trial =1; bool outofguess = false ; Console.WriteLine("Press enter to start"); Console.ReadLine(); do { if (guess
@mambafamkdmambamkdfa107710 ай бұрын
static void Main() { string secretWord = "apple"; string guess = " "; int guessCount = 0; int guessLimit = 3; bool outOfGuesses = false; do { if (guessCount < guessLimit) { Console.WriteLine("Etner your guess"); guess = Console.ReadLine(); guessCount++; } else { outOfGuesses = true; } } while (guess != secretWord && !outOfGuesses); if (outOfGuesses) { Console.WriteLine("You Lose!!"); } else Console.WriteLine("You WIN!!!!");
@MadBunnyRabbit5 жыл бұрын
I would argue that having a game you can't exit from within is a worse design decision than the player having infinite guesses :]