Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 4:979929c6d0b7
- Parent:
- 3:1de5b1ab5880
- Child:
- 5:82076030b7ce
diff -r 1de5b1ab5880 -r 979929c6d0b7 main.cpp --- a/main.cpp Fri Mar 01 00:34:27 2019 +0000 +++ b/main.cpp Fri Mar 01 00:42:06 2019 +0000 @@ -126,7 +126,7 @@ printf("\n"); timeout.attach(&time_expired, 10.0); int answer = get_answer(); - if (answer!=0 && ret.size()<answer) answer = 0; + if (answer!=0 && (answer<0 || ret.size()<answer)) answer = 0; printf("Your answer: %d\n",answer); if (answer!=0 && ret.at(--answer)==correct_answer) { printf("CORRECT!\n");