You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! What's your name? tem
1: Green, like Nature
2: Yellow, like a Sunflower
3: Blue, like the Sky
hello, tem. What's your favourite colour? 4
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at study.learn.storeys.engine.prompters.SimplePrompter.await(SimplePrompter.java:64)
at study.learn.storeys.engine.prompters.SimplePrompter.await(SimplePrompter.java:77)
at study.learn.storeys.engine.demo.Demo.interact(Demo.java:30)
at study.learn.storeys.engine.demo.Menu.lambda$interact$0(Menu.java:38)
at study.learn.storeys.engine.prompters.SimplePrompter.await(SimplePrompter.java:77)
at study.learn.storeys.engine.demo.Menu.interact(Menu.java:36)
at study.learn.storeys.engine.Main.main(Main.java:32)
The text was updated successfully, but these errors were encountered:
@temir20 what's missing here is a check to see if the given value is valid (e.g. the number must be between 0 ( zero is a number ) and the length of the options - 1 ( because we start at zero )
Hello! What's your name? tem
1: Green, like Nature
2: Yellow, like a Sunflower
3: Blue, like the Sky
hello, tem. What's your favourite colour? 4
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at study.learn.storeys.engine.prompters.SimplePrompter.await(SimplePrompter.java:64)
at study.learn.storeys.engine.prompters.SimplePrompter.await(SimplePrompter.java:77)
at study.learn.storeys.engine.demo.Demo.interact(Demo.java:30)
at study.learn.storeys.engine.demo.Menu.lambda$interact$0(Menu.java:38)
at study.learn.storeys.engine.prompters.SimplePrompter.await(SimplePrompter.java:77)
at study.learn.storeys.engine.demo.Menu.interact(Menu.java:36)
at study.learn.storeys.engine.Main.main(Main.java:32)
The text was updated successfully, but these errors were encountered: