State Machine retry count

Hey Guys i have created a random number game through state machine, so guess the correct random number. I want to give each person two chances for guess random number. What is the logic?

@Saikiran_K

Welcome to the community

One way out of many

Use a retry scope and when
Number is wrong throw an error …it would rerun again…

Cheers

Add counter variable to main scope of state machine with value 0. In first state raise counter by 1.
Place 2 transitions:
one to init state when counter is not bigger then 2.
Another one to end state if counter is bigger then 2

I want to give two chances to each person for guessing a random number. if done two chances the bot will be stopped
can you please tell me the logic?

@Saikiran_K

Add your code inside the retry cscope and set the retry number to teo…when number is not identified correctly throw an error…then the code would run again

Cheers

In that retry scope it is asking a condition, what condition needs to give

@Saikiran_K

You can leave the condition blank…it is optional…

Cheers

No it not working.
Did you understand my question.
shall i share my code?

@Saikiran_K

Please share it…

Cheers

Guess the Random number.xaml (15.9 KB)
so my question is i have created a guess random number game. I was using a state machine. so i want to give two chances for each person to guess a random number.
But now it takes many chances until identify the random number.
Please tell me that logic or write that logic and send me back.

Anil_G
Did you see?

Hey @Saikiran_K

in init state I have assigned no of retry counter

image

Here we will check the condtion
Check out this workflow

Guess the Random number.xaml (21.1 KB)

Hope this helps

Cheers

@Saikiran_K

Please check this

Guess the Random number.xaml (19.4 KB)

cheers

1 Like

Yeah it’s workout
thanx for your time

Anil_G

1 Like

It is not workout please check it once

1 Like

@Saikiran_K

Happy Automation

Cheers

Sure
I marked it