I offer that your students code is more efficient in that there are fewer steps for the computer to execute, it is equally as easy to type using ctrl v, and more intuitively obvious so they did not waste time looking for the elegant solution. If you wanted them to do it your way you should have made it 1 - 1000.
For all
Friend of mine told me about his Dad who had to create a random number generator in college back in the days of punch cards. He sequence punched all the numbers in the desired range, threw the box out of a 4 story window, and then collected the cards.
Years ago, i give some homework to my students. A simple stuff for example, a countdown from 10 to 1.
for (i=10;i>0;i--) {
print(i);
}
but i was shocked to find that most students answered with:
print(10);
print(9);
print(8);
print(7);
print(6);
print(5);
print(4);
print(3);
print(2);
print(1);
In my experience, the problem is not the capability, specially since most kids are able to solve simple programming task, the problem is that some people are not really trying.
I have lost to code once, but I stayed alive. Every coder has made crappy code in their lifetime, but the real problem are the people who deliberately make code difficult to read to make themselves "invaluable". Fortunately this is a lot less common now than it was before, but it still happens.