Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,396 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,230 people online right now. Registration is fast and FREE... Join Now!




Maze in C++

 
Reply to this topicStart new topic

Maze in C++, Code-Maze C++

speedgnom
post 22 Aug, 2008 - 03:20 AM
Post #1


New D.I.C Head

*
Joined: 25 Feb, 2008
Posts: 1

I am trying to make a maze game in C++ but im stuck with the code:

cpp
#include <iostream>
#include <conio.h>

using namespace std;

int main(){

char ChessBoard[10][10] = {};

ChessBoard[0][0] = 6;
ChessBoard[0][1] = 6;
ChessBoard[0][2] = 6;
ChessBoard[0][3] = 6;
ChessBoard[0][4] = 6;
ChessBoard[0][5] = 6;
ChessBoard[0][6] = 6;
ChessBoard[0][7] = 6;
ChessBoard[0][8] = 6;
ChessBoard[0][9] = 6;
ChessBoard[1][0] = 6;
ChessBoard[2][0] = 6;
ChessBoard[3][0] = 6;
ChessBoard[4][0] = 6;
ChessBoard[5][0] = 6;
ChessBoard[6][0] = 6;
ChessBoard[7][0] = 6;
ChessBoard[8][0] = 6;
ChessBoard[1][9] = 6;
ChessBoard[2][9] = 6;
ChessBoard[3][9] = 6;
ChessBoard[4][9] = 6;
ChessBoard[5][9] = 6;
ChessBoard[6][9] = 6;
ChessBoard[7][9] = 6;
ChessBoard[8][9] = 6;
ChessBoard[9][9] = 6;
ChessBoard[0][9] = 6;
ChessBoard[9][0] = 6;
ChessBoard[9][1] = 6;
ChessBoard[9][2] = 6;
ChessBoard[9][3] = 6;
ChessBoard[9][4] = 6;
ChessBoard[9][5] = 6;
ChessBoard[2][2] = 6;

for(int i = 0; i<10; i++){
for(int j = 0; j<10; j++){
cout << ChessBoard[j] << " ";
}
cout << endl;
}




getch();
return 0;
}


Is it posible to make a maze game with this code if so please help.

Mod edit: Please code.gif
Thanks, gabehabe smile.gif
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 22 Aug, 2008 - 03:34 AM
Post #2


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


There would be a lot more work to make it into a maze.

You need to think about cursor activity, how to move the player when a particular key is pressed.

There's a decision as to whether you're going to randomly generate working maze maps, or just save presets and load them, and you would have to consider collision detection.
User is offlineProfile CardPM

Go to the top of the page

dwayne
post 22 Aug, 2008 - 07:10 PM
Post #3


New D.I.C Head

*
Joined: 2 Aug, 2008
Posts: 39


My Contributions


Since you tagged this as "beginner", I'm assuming this is one of your first projects. Its good that you want to make such a program but I recommend starting out maybe with something like a single, static, maze, and then move on up to random, and so on.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/22/08 07:23AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month