No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
14 Posted Topics
When I did my RNG for my RPG, I had to do [code]void initialSeed(){ srand((unsigned)time(0));}[/code]
As part of a project I'm working on, I need to develop a program that can take in a sentence and convert it somehow (I'm choosing to convert into Pig Latin). At first I thought this was going to be a piece of cake, until I realized that after [code]#include …
So for my project I'm working on, we have to simulate a game of Sorry. There are 1-4 players who are each represented by a color. Player 1 is always BLUE, 2 is YELLOW, 3 is GREEN and the 4th player is RED. Each color has it's own unique start/home …
[QUOTE=dougy83;705557]What?? I know a lot of people who will write code for money (myself included). I believe it's fairly standard practice; even a respectable career option.[/QUOTE] That may be true, but in the world of Academics they consider that Academic Dishonesty, which tends to be a big deal.
To pass an ifstream type as an argument for a function? [code]bool initGame(Game &game, int argc, char *argv[]){ ifstream board(argv[1]); // <------------------- This part ifstream deck(argv[2]); int numPlayers= atoi(argv[3]); int numRounds= atoi(argv[4]); if (board.fail() || deck.fail() || numPlayers==0 || MAXPLAYERS < numPlayers || numRounds < 1 || numRounds > 1000 …
While working on my CS project, I coded the following line: [code] if(...*stuff* || *morestuff* || *evenMOREstuff* || (strcmp(argv[5], "yes") && strcmp(argv[5], "no"){ cout << "Improper arguments." exit(1); } else{ do more stuff} [/code] Where argv[5] is a program argument supplied by the user. Either a yes or a no …
How do I write it so if I have ifstream file("file.txt") that has rows of characters like 60 REGULAR NONE GREEN BEGIN REGULAR NONE REGULAR NONE GREEN END that I can read one line at a time and do whatever I need with it.
[code= c++]#include <iostream> using namespace std;// You forgot your include files, as well as your namespace float hipvalley(); float cricketvalley(); float ridgeangle(); int main() { cout << "Copyright 2001, Welcome to the Angle Finder Program." << endl << "This program is designed to take only numeric values." << endl << …
So... here I am again. Items are a pretty important part of RPGs, so I'm probably going to have to code them in at some point. My basic idea is this: I'll start with an abstract class called "Item". From there, it'll be broken down into several subclasses, including "Equipment" …
While we're semi on the topic, could someone please tell me what the difference between if{, else if{ and else{ is?
You just need to add cin.get(); at the bottom, right before the closing {
Back with another question concerning my RPG. I had the idea to do a multi-dimensional array to represent a map, with each element in the array being it's own square, Depending on where you are, you can move in any of the 4 directions, unless you are on an edge. …
I thought you needed to #include <cstdlib> in order to use the rand() function...?
I'm having this weird issue with a text based RPG I'm trying to create. I'm fairly new to C++, so I thought having a project that I can work on and expand as I learn more would be a good way to put what I have been reading about into …
The End.
Ellisande