UiPath Do While Number Guesser Game Challenge Project |Video upload date:  · Duration: PT5M33S  · Language: EN

Build a Do While number guesser in UiPath using loops variables input validation and feedback for practice and learning automation concepts

Build a playful UiPath Do While number guesser

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.

Core idea

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.

What to set up

  • targetNumber as Integer
  • guessedNumber as Integer
  • attemptCount as Integer initialized to 0
  • rawInput as String to hold dialog text

Random number generation

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.

Input and validation

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.

Do While loop

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.

Feedback and counting

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.

Quick workflow steps

  1. Create variables with clear names
  2. Assign targetNumber = new Random().Next(1, 101)
  3. Start Do While with condition guessedNumber <> targetNumber
  4. Show Input Dialog and store result in rawInput
  5. Parse rawInput using Try Catch or Integer.TryParse
  6. On successful parse increment attemptCount and compare numbers
  7. Show Guess higher or Guess lower or the success message

Tips for practice

  • Use descriptive variable names so you can remember what you did the next day
  • Keep parsing inside Try Catch or use TryParse to avoid ugly exceptions
  • Add range checks to ensure guesses stay between 1 and 100
  • Log attemptCount for debugging and mild bragging rights

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.