No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hey all, I just wanted to know if I should use a different process to run my loop. I use a while loop until the AI figures out the number. I know there is a more efficient and easier way to make this loop happen with BOOLEAN. Setting while(bool = … |
|
Just a little code I have been working on. New to programming and learned about rand. I applied it in this program. Like I said I'm new to programming and if there is a *easier and more effective way* to write some of my code, please tell me. The part … |
|
if (map[xPos][yPos] == map[xTPos][yTPos]) this works and does what I want it to do. But when I increase the traps. Multiple traps "5" display on the grid but only the last one (assuming) that is created will trigger my if statement. I was trying to add map(i)[xTPos][yTPos] but I'm having … |
|
If I use classes, will this reduce my lines of code? Is this a good way? Should I use a header for certain functions? Thanks ( Just wondering, thanks [CODE]/* Ask how many sides a shape has, go to that shape, ask for values to do questions about the shape … |
|
There is a easier way and more efficent way to do this with a for loop I believe...I can't put the nail on it can anyone help me out? I want to move a character around in a array...right or left or up and down with md arrays. [CODE] #include … |
|
I understand that bool means true and false. If I was doing a while loop... [CODE] while(!GAMEOVER) do all this... GAMEOVER = 1 or TRUE (loop exits) [/CODE] IS the above correct? And is there any other ways bools are used to help reduce clutter? Thanks, Derek |
|
If I end my cost of .60 cents with a [B]NICKLE [/B]or a [B]DIME [/B]I get a 2.####.E number. If I end the total cost with a quarter I don't get a big number ( Wrap around number right ? ) Can anyone tell me why? [CODE]#include <cstdlib> #include <iostream> … |
|
I just started to get a grasp of classes. I can't find my answer anywhere, and I hope someone on here can answer it. I am trying to simlate a battle [B]USING CLASSES[/B] Everywhere I look on the net people in C++ don't use classes to simulate battles. You could … |
|
Re:
oh my please help me..i;m making a simple code in c++ using dev c because i am exploring this language for my second year. i do not know why it will not display the output..i don't know how to use cin..[CODE]#include <iostream> using namespace std; int main() { cout << … |
|
I have tired several things....And i still can't pinpoint on what I can do differently. I want the dowhile loop to run untill r, b or g is entered. I have tried commas like in the below code and other things exp... while (pick != r || pick != 'g' … |