You mean as we didn’t seeSean Heise wrote: . . . As you can see the other thread . . .
Please tell us where you found that info, so we can avoid that site!When I googled it, it looked like I would set up an array as:
StringBuilder[] Fib = new StringBuilder[intFibN]; . . .
Sean Heise wrote:...I figured if the program works, why mess with it? >.<
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie wrote: - 2 and start with index 2.
Campbell Ritchie wrote:Please tell us where you found that info, so we can avoid that site!.
Sean Heise wrote:I disagree that there's a wrong way or right way to program, my program isn't incorrect and still works. So saying that "learning something about programming" is subtracting two instead of adding two, is completely ludicrous.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Sean Heise wrote:...
I've spent plenty of time slamming my head against my keyboard
...
I'm just frustrated, ...
OCUP UML fundamental and ITIL foundation
Campbell Ritchie wrote:The website I asked about avoiding doesn’t come up. I shall try to edit your post, because I think there is a spelling error in the link.
There are people who take programming courses because they want to program and people who think they have to as a part of a larger course. But you might as well get the best mark you can.
You achieve two things by banging your head against a keyboard. A damaged computer and a headache.
If you stepped back and got a piece of paper and wrote something like this on it, you would see what I meant by starting at No 2.You have to put it in code tags on this website to get the numbers aligned. If you stepped back and worked out the algorithm, you could work out the workings of your array in a few minutes. And you could avoid getting annoyed with yourself and everybody else.
Fred, Bear and Dennis are right.
It is quicker to start from scratch, working out the algorithm, than to tinker with code which nearly works. I was very brief about the 2 and -2, and you ought to have asked for more explanation rather than guessing what I meant. You can guess a million times, and your code looks as if you are guessing. Within those million you will find something which works. Or you can work it out, which means paper pencil and eraser (the latter being the most important). And get it right first time. And get elegant code.
When I say paper and pencil I mean paper and pencil. Turn your PC off. You can turn it on when you have worked out the algorithm and see it work