• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About FlyingMudPuppy

  • Rank
  1. Help Im Drowning!!!

    Quote:Original post by stupid_programmer Make sure Visual Studio knows the path to the Allegro header files. Tools->Options->Projects and Solutions->VC++ Directories then select 'Include Files' and point it to the folder with the header headers. You'll need to do the same with the library files but that will be 'Library Files'. And yes I did this already according to the instructions on the site at the link I provided.
  2. Help Im Drowning!!!

    In the error window you guys made reference to (after building the solution (failed), cleaning it (successful), and building again (failed again...) a single error read: Error 1 fatal error C1083: Cannot open include file: 'pc.h': No such file or directory c:\documents and settings\god\my documents\visual studio 2008\allegro\include\allegro\platform\aldjgpp.h 20 EDIT: I checked in My Computer, and found aldjgpp, and I clicked properties and looked at the directory: C:\Documents and Settings\God\My Documents\Visual Studio 2008\allegro\include\allegro\platform and it is a C++ header file. I really don't get it.
  3. Help Im Drowning!!!

    Okay I know that was a bit dramatic, but this is a desparate time. I have now spent more than five hours in the last two days trying to get both Visual c++ Express and Allegro up and running. As far as I know I installed the former correctly, but I seem to be having issues with Allegro. After I downloaded 4.2.2 (Allegro), I went to this link for help "syncing it with Visual C++: http://csfinch.wordpress.com/2008/04/25/setting-up-allegro-422-in-visual-c-08/ My problem is when I build the file, at the bottom of the screen it says "Build Failed" with no explanation. I then try running it anyways (ctrl+f5) and a screen comes up saying "This project is out of date: firstAllegro-Debug Win 32 Would you like to build it?" Then I select yes, and a new window appears: "There were build errors. Would you like to continue and run the last successful build?" I choose yes again, and get a final window: Unable to start program 'C:\Documents and Settings\God\My Documents\Visual Studio 2008\Projects\firstAllegro\Debug\firstAllegro.exe' System can not find the path specified. I honestly have no idea what is going on and am really starting to lose interest... If you are reading this I thank you in advance for commenting a little advice...
  4. Help! Trying to get Allegro to work in VC++

    But if there is a way to delete your threads please tell me so I can get rid of this one [Edited by - FlyingMudPuppy on October 22, 2008 7:48:34 PM]
  5. Sorry everyone I reposted this in the beginner section please let the thread disappear [Edited by - FlyingMudPuppy on October 22, 2008 7:13:00 PM]
  6. Where do I go from here?

    Thanks for the input guys. I guess one of the answers to my questions was right in front of me.... Q: What are some examples of the uses of pointers? A: Linked Lists! And yeah its pretty cool to get these courses in high school. Part of it is that we have an amazing teacher would could probably be making millions in another career. I guess its like that with most classes, that the difference between a good teacher and an amazing teacher makes a huge difference. The problem is that people good enough to be amazing usually find other, much more appealing (almost always at least as far as pay)career.
  7. Where do I go from here?

    I just downloaded the .NET 3.5 Frame stuff and then Visual c++. I was wondering what I have to do after downloading Allegro to get it to 'sync' with Visual C++.
  8. Where do I go from here?

    Here's what I know and have done so far: 1. Semester (in 9th grade) of "Programming" in Visual Basic where we basically made games for projects, and for my final I made a pretty crafty snake game. 2. I took (10th grade) AP Computer Science A, which is taught now in Java. We learned the basics, getting up to abstract classes, interfaces, those sort of things. Unlike my teacher's programming course, this one put no focus on games, aside from out semester projects of tic-tac-toe (just the AI), and minesweeper (again just the algorithms persay, with no focus on the graphics or way the project was put together) 3. This year (11th grade) I am taking AP Computer Science AB (the last year the College Board is offering a second level :(, which is tragic). Its focus (still in Java) so far seems to be data structures. We have just completed a unit on linked lists, and are moving on to stacks, and I believe trees after that. -My problem with C++ is that I do not know if there are things equivalent in it to things in Java. Ex: In one of my C++ programs I really wanted a growable list but do not know if there is a default class like the ArrayList in Java. Also, I think I am missing a major idea behind pointers. I am just not quite sure why one would use them, and at what times it is appropriate/better to use them. If you have any ideas that could help me learn pointers (a program idea) they would be welcome. 4. I have decided that for me a major of Computer Science in college may be in my future, and want to learn C++. I have two books on C++ that seem to help. I also love to play games, and loved what little experience I had with making them. I have figured out some of the basic differences from C++ and Java, and have made some basic text based games in C__. 5. I want to move up to 2D games like pong or tetris, and was wondering what you need to do that. Is it some kind of new library, a program, etc.? I really need very straightforward instructions when it comes to downloads and stuff like unzipping (I am not very computer saavy). *For the record currently I am using a Dev-C++ enviroment/compiler that came with one of the books I got. I also would not be opposed to spending some money on a book or reference more directed towards game development. Thanks in advance for the advice! [Edited by - FlyingMudPuppy on October 21, 2008 5:25:23 PM]
  9. Help with debugging

    Here are some of the statements I recieved from the compiler: 44 C:\Dev-Cpp\SouceFileBombGame.cpp `player' was not declared in this scope 44 C:\Dev-Cpp\SouceFileBombGame.cpp parse error before `,' token 54 C:\Dev-Cpp\SouceFileBombGame.cpp parse error before `)' token 56 C:\Dev-Cpp\SouceFileBombGame.cpp semicolon missing after declaration of ` /Dev-Cpp/SouceFileBombGame.cpp C:\Dev-Cpp\C In constructor `bombBoard::bombBoard(int, 11 C:\Dev-Cpp\SouceFileBombGame.cpp `rows' undeclared (first use this 11 C:\Dev-Cpp\SouceFileBombGame.cpp (Each undeclared identifier is reported ..... and it goes on tenfold, but with most of the errors looking pretty similar to these first few
  10. Help with debugging

    Okay I just downloaded a compiler off of a CD that came with a book, and wanted to make a quick program. The goal was to have a player class used by a board class which would allow me to move the player(s) around. The main method set up a basic looping that could later be used in a simple text based game. I have gotten many errors and frankly after an hour of pondering do not know what to do. Forgive me for any glaring mistakes my only experience is with Visual Basic and Java in school for two semesters. so here is the code: #include <iostream> #include <string> using namespace std; class bombBoard{ public: bombBoard(int numrows, int numcols, char letter){ rows=numrows; cols=numcols; symbol=letter; numPlayers=0; for(int r=0;r<numrows;r++) for(int c=0;c<numcols;c++) board[r][c]=letter; } void printBoard(){ for(int r=0;r<rows;r++){ cout<<"\n"; for(int c=0;c<cols;c++) cout<<board[r][c]; } cout<<"\n\n"; return; } //moves a player within the board bool movePlayer(int pnum, int row, int col){ if(board[row][col]!=symbol||players[pnum-1]==null){ cout<<"Not a valid move choice"<<endl; return false; } board[players[pnum-1].getRow()][players[pnum-1].getCol()]=symbol; players[pnum-1].moveTo(row, col); board[row][col]=players[pnum-1].getSymbol(); printBoard(); return true; } //adds a player to the board void addPlayer(player playa, int playanum){ players[playanum-1]=playa; numPlayers++; board[playa.getRow()][playa.getCol()]=playa.getSymbol(); return; } int getRows(){return rows;} int getCols(){return cols;} char getSymbol(){return symbol;} int getNumPlayers(){return numPlayers;} player getPlayer(int playernum){return players[playernum-1];} protected: char board[50][50]; int rows; int cols; int numPlayers; player players[10]; char symbol; }; class player{ public: player(char symbol2, string title, int startrow, int startcol){ symbol=symbol2; row=startrow; col=startcol; name=title; } int getRow(){return row;} int getCol(){return col;} char getSymbol(){return symbol;} string getName(){return name;} void moveTo(int newrow, int newcol){ row=newrow; col=newcol; } protected: char symbol; int row; int col; string name; }; int main(int nNumberofArgs, char* pszArgs[]){ int numRows, numCols, numPlayers, currentNumPlayer=1; char symbol; cout<<"Enter the number of rows:"<<endl; cin>>numRows; cout<<"Enter the number of columns:"<<endl; cin>>numCols; cout<<"Enter the default symbol:"<<endl; cin>>symbol; cout<<"Enter the number of players:"<<endl; cin>>numPlayers; bombBoard myBoard(numRows, numCols, symbol) while(1){ if(currentNumPlayer>=5){ cout<<"Maximum player number reached."<<endl; break; } int startRow, startCol, val; char symb; string name; cout<<"Enter 0 to exit, any other number to continue:"<<endl; cin>>val; if(val==0) break; cout<<"Enter the name of the player:"<<endl; cin name; cout<<"Enter the starting row of player "<<currentNumPlayer<<":"<<endl; cin>>startRow; cout<<"Enter the starting column of player "<<currentNumPlayer<<":"<<endl; cin>>startCol; cout<<"Enter a 1 key symbol for player "<<currentNumPlayer<":"<<endl; myBoard.addPlayer(player johnDoe(symb, name, startRow, startCol), currentNumPlayer); currentNumPlayer++; } int currPlayerNum=1; while(1){ int newRow, newCol, val; cout<<"Enter 0 to exit, any other number to continue:"<<endl; cin>>val; if(val==0) break; cout<<"Player "<<currPlayerNum<<" enter a new row:"<<endl; cin>>newRow; cout<<"Player "<<currPlayerNum<<" enter a new column:"<<endl; cin>>newCol; if(!myBoard.movePlayer(currPlayerNum, newRow, newCol) continue; if(currPlayerNum!=myBoard.playerNum()) currPlayerNum+=1; else currPlayerNum=1; } system("PAUSE"); return 0; }
  11. C++ Basic Organization

    So far I all know (well I think I know) is that the organization levels go from *Libraries which are made of *Packages which are made of *Classes which are made of *Objects and Functions which are made of *Primitive Data I'm not even sure what an object is... I'm also wondering how you create/declare and then use each of those items... Kind of a broad topic, but then again I'm kind of confused... Any help or examples (not source code just in layman's terms) would help me immensely.
  12. How low is a beginner here?

    Quote:Original post by Korishoba By the way thanks guys. I was kind of worried I was stepping out of my league. Cool you're a sophomore? Me too! The only real experience I have is with Game Maker. I'm making my own Mario game (I've done 3 levels working on the 4th). I'm also getting used to 3DS Max. Cool I know about C++ but I don't think my school has it. I do know a kid who uses it though. In Game Maker I know how to make a basic scrolling shooter and platformers, but I really want to get into the 3D stuff. It sounds like you have something that is designed for making games. We just learned the basics (like really really really basic) of programming and problem solving that is involved. The most complicated thing I did in visual Basic was make Snake and a program that would read in Sudoku files and would correct the player and give hints to the answer. It was a lot easier because we had a form, and could make our objects on it. I mean we could drag and drop timers.... It was all so easy... C++ and Java seem to be different in that with just a compiler I don't know how to make objects yet. Because of that I'm stuck making word games on the DOS prompt (and that is about as fancy with the lingo as I can get now). My goal is to be able to make some 2D games (using physics, which I am taking this year) by around Christmas. Im just planning on getting some books from a library, and then just working my way up starting simple.....
  13. How low is a beginner here?

    Hey buddy. I asked the same thing when I joined like a week or two ago. Im a sophmore in high school, and my only programming experience was a semester class where we made games with visual basic (in 9th grade). I thought it was easy, so I looked into doing some out of class. This year Im taking some AP Comp Sci class which works with Java. On here Im trying to learn C++ because it seems to be pretty popular (please dont get mad for that last thing).... Yeah I really dont know very much at all, but am trying now to make tictactoe....
  14. Recursive Functions(C++)

    An example of a RF (I think Im new at this) *Its supposed to be a greatest common factor program... int GCF(int numa, int numb); int main(){ int a, b; cout<<"Please enter one number and press ENTER: "<<endl; cin>>a; cout<<"Please enter one number and press ENTER: "<<endl; cin>>b; cout<<"The GCF is: "<<GCF(a, b)<<endl; return 0; } int GCF(int numa, int numb) { if (numa%numb==0) return numb; else return GCF(numb, (numa%numb)); }
  15. Tic-Tac-Toe Help

    Okay. So far I am at very beginning stages in C++. I made a guessing game, and now am trying to make tic-tac-toe (in the DOS prompt-if I even said that right). I have done the coding to pick your spots. I am having a computer control the other team. Now I have to make it smart.... Quite a challenge for me, even a Lv 2 AI will be hard. Edit 2: (EDIT 1 deleted) Well my first problem was solved, and as of now I really only have general questions not game specific... ----------------------------------------------------------------------------------- EDIT 3: Yeah right as you posted it I figured it out. If i input n, the remainder that is returned cant = n, which is the result I wanted. So actually I don't need to subtract 1 from the value because it is already ready to go into the array reading loops. Thanks for the help! I went back through my code and put in a bunch of comments. I had also left out a seed timer thing to make it random every time. I also hadn't even realized the <> thing with my posts. Duh! But really, thanks for the etiquette and coding help! Can't believe it was really that simple. Buts that why im getting into this. I love the problem solving stuff, and the debugging can be also as interesting. Its a lot of logic, and I hope I can get a knack for that kind of stuff you just did with seemingly little effort... Well, here's the new code. Now comes the hard part, trying to make a semi-intelligent computer. Im thinking like a level 2 AI, which will hopefully recognize and act on winning move possibilities and win preventing moves. All I have right now is the level 1, a completely random one which wouldn't really be that entertaining. And by the way, I see the syntax std::cout a lot and am not really sure why I am not using it.... Also I get a warning when I compile/build... It says: .\TICTACTOE.cpp(20) : warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data--not sure what this means either //#include <stdafx.h> #include <iostream> #include <math.h> #include <stdlib.h> #include <time.h> //#include <string.h> #include <string> #define STRMAX 600 #define VALUES 5 #define VALUES2 6 using namespace std; //declare an array taken which can be used to see if a spot is taken int taken[3][3]; //the main int main(){ srand(time(0)); //make all of taken false for(int i=0;i<3;i++){ for(int g=0;g<3;g++){ taken[i][g]=0; } } //declare function to check for taken being true--maybe not necesscary, but if it doesnt cause problems Ill leave it int checkloc(int n, int i); //random number function for some computer moves int randnum(int n); //string for the spots-will be either x or o string tictac[3][3]; //declare some strings string yesno, xorO, xorOc; //declare the movement ints for human and computer (computer has a c at end) int movecol, moverow, movecolc, moverowc; //makes each spot "empty" for printing purposes for(int i=0;i<3;i++){ for(int g=0;g<3;g++){ tictac[i][g]="empty"; } } //sets up a loop so after a game ends it will go again while(1){ //if they say yes it runs, no it breaks, and if neither then it prompts for a vaild answer cout<<"Start a new game? (yes or no): "<<endl; cin>>yesno; cout<<endl; cout<<endl; while(yesno!="yes"){ if (yesno=="no") break; if(yesno!="no"){ cout<<"Please enter yes or no (as to whether to start a new game): "<<endl; cin>>yesno; cout<<endl; cout<<endl; } } if (yesno=="no") break; //displays the "board"--rows are the first number in array throughout program (accidental) for (int i=0;i<3;i++){ cout<<tictac[0][i]<<" "; } cout<<endl; for (int i=0;i<3;i++){ cout<<tictac[1][i]<<" "; } cout<<endl; for (int i=0;i<3;i++){ cout<<tictac[2][i]<<" "; } cout<<endl; cout<<endl; cout<<endl; //asks for what you would want to be++xs go first? cout<<"Would you like to be Xs or Os? (x or o): "<<endl; cin>>xorO; while(xorO!="x"){ if(xorO=="o") break; if(xorO!="o"){ //makes sure you enter something valid cout<<"Please enter x or o (as to whether you would like to be Xs or Os): "<<endl; cin>>xorO; } } if(xorO=="x") //if the player chooses one, it makes the computer the other xorOc="o"; else xorOc="x"; cout<<endl; cout<<endl; //the while loop is for the game being played++make a break if win while(1){ cout<<endl; cout<<endl; //gets the row the player wants to move in cout<<"Please pick the row you would like to move in."<<endl; cin>>moverow;//error?--after I added srand //gets the column the player wants to move in cout<<"Please pick the column you would like to move in. You are moving in row "<<moverow<<"."<<endl; cin>>movecol; //subtracts 1 from each value so they can be read in the arrays (they start with 0, user will enter 1) movecol=(movecol-1); moverow=(moverow-1); //check for the location being used checkloc(moverow, movecol); //a loop to pick a new location if the previous is taken while(checkloc(moverow,movecol)){ cout<<endl; cout<<endl; cout<<"Please enter a new, untaken position."<<endl; cout<<"Please pick a row that you would like to move in."<<endl; //get a new row cin>>moverow; //get a new column cout<<"Please pick a column that you would like to move in. You have already selected row "<<moverow<<"."<<endl; cin>>movecol; //convert down 1 number movecol=(movecol-1); moverow=(moverow-1); //check location for being taken checkloc(moverow, movecol); //if checkloc returns 0 then break out of loop if(checkloc(moverow, movecol)==0) break; } //make the current spot (will be legal) taken (by equaling 1) taken[moverow][movecol]=1; //make the spot (type string) equal to the user's letter (x or o) tictac[moverow][movecol]=xorO; //get two random values for the computer's move, take one off to make it array compatible moverowc=(randnum(3)); movecolc=(randnum(3)); //check for it already being used while(checkloc(moverowc, movecolc)){ //if it is not taken then break out of the loop if(checkloc(moverowc, movecolc)==0) break; //give new values for the computer, subtract 1 moverowc=(randnum(3)); movecolc=(randnum(3)); } //register the spot (legal) as taken, and make the spot (string name) the computer's letter (one that the player does not have) taken[moverowc][movecolc]=1; tictac[moverowc][movecolc]=xorOc; //print the new board for (int i=0;i<3;i++){ cout<<tictac[0][i]<<" "; } cout<<endl; for (int i=0;i<3;i++){ cout<<tictac[1][i]<<" "; } cout<<endl; for (int i=0;i<3;i++){ cout<<tictac[2][i]<<" "; } cout<<endl; } } return 0; } //check for computer too int checkloc(int i, int n){ //if taken is true if (taken[i][n]) //return 1 as true value return 1; else //return 0 as false value return 0; } //the random number generator int randnum(int n){ //the %n gets a remainder which can be from 0 to n-1 return rand()%n; } EDIT 4: Can you do a statement like this? if(...){ .... } else(...){ .... } else(...){ .... } EDIT 5: Thank you very much for the information John. So if I should use std::cout does that mean that :: calls a function for std? And if so what does that make std? What else should I use std:: with? Things like cin? And thank you for the else if syntax. [Edited by - FlyingMudPuppy on September 5, 2007 4:22:24 PM]
  • Advertisement