Giveaway answer fields in challenges | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 4

Giveaway answer fields in challenges

Hi everyone. I was wondering whether it would be possible to change the way we input the answer to ā€œWhat is the output of this code?ā€ questions, at least in challenges; otherwise, the number of characters required will often give the answer away. For example, the question below should presumably test oneā€™s understanding of the && operator, but since the output must be 7 or 10, and the answer can only be one character in length, it isnā€™t necessary to worry about the actual question! What is the output of this [c++] code? int x = 7; int y = 3; if (x > 5 && y < 2) cout << x + y; else cout << x - y; Just a thought... šŸ˜

28th Jun 2019, 3:22 PM
Ed Morrow
4 Respostas
+ 15
Not a bad idea, although in your example, it's easy to use 6 instead of 7 and fix the problem: int x = 6; int y = 3; if (x > 5 && y < 2) cout << x + y; else cout << x - y; i like it when i see that the challenge creators have taken care of it in a creative way.
28th Jun 2019, 3:30 PM
CĆ©pagrave
CĆ©pagrave - avatar
+ 11
Agreed, I've also noticed
28th Jun 2019, 5:22 PM
HumayrašŸ‡§šŸ‡©
HumayrašŸ‡§šŸ‡© - avatar
+ 10
I agree and if I remember right once asked the community a very similar question but there was not much support for changing things.
30th Jun 2019, 5:21 AM
Sonic
Sonic - avatar
+ 3
Good point, thereā€™s probably usually a way to fix the questions themselves, which would be a lot simpler. I have seen quite a few where itā€™s possible to ā€œcheatā€, though.
28th Jun 2019, 3:42 PM
Ed Morrow