Yes!
And since there is ALWAYS another empty square in this pirouette pattern, until they're all full, only one loop is needed.
Type: Posts; User: Adak
Yes!
And since there is ALWAYS another empty square in this pirouette pattern, until they're all full, only one loop is needed.
How do you want to ignore them, and when?
If I gave you a list of numbers with some negative numbers to be ignored, and you had no computer, how would you go about ignoring those negative numbers...
Run my program. Your position in the array has to move all four directions: up, right, down and left. You need only one loop, but you need some kind of logic to control the movement in all four...
OK, Mr. Dancer! Anything else you'd like to tell us? <ROFL>
You could put a, b, *recs, and rectangle[50], all on the same line of code, since they are all RecT's data type.
You posted:
Which looks like three different rates to me.
The only way to learn this, is by doing it. Take a paper and pencil, and work through some simulated rental costs, for different...
It's smart to take it step by step, compiling every few lines to check the syntax. You CAN have structs defined inside a function, but then you can't easily make an instance of the struct, inside the...
You can control the movement through the array, with just one loop, but in noting how simple it was in pseudo code, I probably misled you as to the actual code.
You're on the right track, but...
Holy Moley!
It's not a different function for every direction - it's one loop, with one turn, when you can't go straight in the direction you are traveling now, and loop.
DING! DING! DING! Winner winner, chicken dinner! :)
I beg to differ, Roadrunner - it makes me feel SOO GOOOD! <j/k>
problem #1:
1) Is the struct definition, above main(), before any other functions? If not, make it so.
2) Move the declaration...
You can use either a for or a while or a do while loop. They all can be made to work in place of the other. I like the for loop for this one.
You turn right on square one, and enter the loop.
...
Nothing wrong with that approach, but it's more code. This algorithm minimizes BEAUTIFULLY, if you let it. WAY EZ.
If you don't need to add taxes, etc., then LEAVE THAT PART OUT. You WILL need to calculate at least three different rates, however. Your calculations MUST be similar to what I wrote above.
This is...
NO! God NO! Don't start counting steps! :(
It's simple, in one loop, you have two if statements. The loop ends when there are no vacant squares left. It's EZ!
Yes, I made a maze solver program...
There isn't just ONE WAY to make this calculation. ATM, I'd look to changing all the time intervals into minutes. Lots of them, won't both the computer at all.
Then see, how many (if any) minutes...
Follow the "right hand rule":
1. Start by going right, as far as you can. Put a unique "have been there" value, into each square of the array, you have visited.
2. When you can no longer move...
You are doing the time calculation yourself - so you don't need time.h. time.h is used mostly when your program needs to work with the reported times from the computer.
You can keep all your...
The only reason I'm able to help you Juan, is because you have posted some code. That's a rule on the forum, because otherwise we become the "short order" center for students to get their homework...
Sure, are you using a while loop? As the while loop moves up the array of top names, each name can be strcpy()'d down to the next index number. array[98], becomes array[99], then array[97] is...
Yes indeed. the char array[10][20], can be printed out with
for(i=0;i<10;i++)
printf("%s\n",array[i]);
which is a very handy way to print out strings. Replace the printf() line of code...
To save a list of names, you would need a two dimensional array (length and width).
Instead of name1[10] which is one dimensional, you need names[10][20]. That would give you room for ten names,...
I like your idea Juan. Why not try it out with say, 20 names, and keep the lowest 10 of them, in an array. Work through the details of the code, and then jump it up to the million names, and 100...
Not all boards are using chipsets that support the HPET fully, yet. MS is providing some software support for them, and for legacy users of it's older Multimedia timer as well, but it has become...
The problem is where you change over from fscanf() to fgets(). fscanf() scans and saves (hopefully) the file data UP TO BUT NOT INCLUDING, the newline char. So when fgets() begins saving data, it...