Welcome to a tiny RPA game that tests user patience and your debugging skills. You will make a number guesser using a UiPath Do While loop that prompts a player until they get the secret number. This project is a great beginner practice task to learn variables loops random generation and input validation without setting your keyboard on fire.
Pick a random target number. Ask the user for a guess. Compare the guess to the target. Give feedback to guess higher or lower. Repeat until the guess matches and then reveal the glory of attempt count and mild triumph.
Use an Assign activity to set targetNumber to new Random().Next(1, 101) so the secret lives between 1 and 100. That is the number the user will chase like a suspiciously motivated cat.
Use an Input Dialog to capture rawInput. Parsing user text is where chaos happens so wrap parsing in a Try Catch block or use Integer.TryParse(rawInput, guessedNumber) and check the Boolean result before comparing values. If parsing fails show a friendly Message Box and loop back for another attempt.
Place a Do While activity that continues while guessedNumber <> targetNumber. The Do While ensures the dialog appears at least once which is exactly what this game needs since users do not start knowing the secret.
Inside the loop increment attemptCount after a successful parse and before feedback. Use If activities to compare guessedNumber and targetNumber and display messages like "Guess higher" or "Guess lower". When guessedNumber matches targetNumber exit the loop and show a final Message Box with attemptCount and a congratulatory line that is slightly less cheesy than a motivational poster.
There you go. You now have a concise UiPath Do While number guesser that teaches random number generation loop structure user interaction and validation. Add it to your practice projects and enjoy watching automation behave nicely for once.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.