No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
5 Posted Topics
One method to solve a maze is to consider the walls more as a door that is open (available) or closed (already tried). Boundaries are marks closed as are the solid walls. the sequence would be: 1) Enter cell 2) If this cell contains cheese, stop -- maze solved 3) …
Take a close look at line 22. Modulo returns a number from 0...N-1. So modulo 99 + 1 returns a value from 1 to 99 not 100. Also, look at lines 68, 74, 79. Shouldn't this be one line outside the if()s?
You also need to consider the following: 1) The results might not be integers 2) The initial equation uses discount and I think you're looking for 100% - discount 3) Discount should probably be in the range 0.0 - 1.0 or you need to divide by 100 to correct the …
Consider the following: [code=C++] inline char IsPositive(double r) { return ( (r < 0.0) ? 'N' : 'P'); } [/code]
Consider that the difference between filled and unfilled is whether the fill character is a space of the same as the edge. Just write a unfilled routine and either chFill is a space or chEdge.
The End.
kjc367