Recent Posts

Pages: 1 [2] 3 4 5 6 ... 10
11
Community Speak / Re: Life
« Last post by TentaCell on November 29, 2013, 03:58:16 AM »
He was Paul Gilbert IIRC but whatever. Hm...what I'm up to these days? Got my driver licence months ago (I think I have already spoken about this somewhere before) and quit my job in september to go to the army in a couple of months (yeah it takes time to get in shape lol). And voilĂ ! I'm kinda back to game making to, still debating what sort of game I'm gonna do and how but I hope I will stick with it (aaah, the joys of procrastination lol).

 :)
12
Beginner Projects / Re: ABS + Jump
« Last post by Xavier on September 05, 2012, 03:52:11 AM »
i know there's a 95% chance the guy won't visit this place anymore but I tested this project and darn, that looks like some heavy coding right there. Didn't open the thing in rpg maker because I don't want to get a severe headache but anyway, good job to the guy.
13
News and Updates / Re: Site Changes
« Last post by Cypras on August 13, 2012, 05:21:01 AM »
Great news for you man. Nice to see things working out for you.
14
News and Updates / Re: Site Changes
« Last post by Xavier on August 10, 2012, 03:46:57 PM »
Good news ! ;)
15
News and Updates / Site Changes
« Last post by xfixium on August 09, 2012, 12:17:29 PM »
I'm moving into a partnership and we've decided to keep the pyxosoft name for the new partnership. This site is moving into legitimate indie development. Thus this forum will be moved on the new server. Haven't decided exactly where yet, but this is a good time to get any resources before the move. I'll update with dates and details as they come up. Sorry for the inconvenience.

-Xfixium
16
Advanced Projects / Re: Screenthread
« Last post by Rayo on January 16, 2011, 06:41:31 AM »
Here another screen for my project:
17
The Binary Cafe' / Re: My Final Exam
« Last post by Jeod on December 02, 2010, 05:26:18 PM »
Code: [Select]
/*
Solve the following 20x10 maze using an algorithm:

####################
##  #    ##    ### #
## # ###     #     #
#  # # ##### #######
# ## #    ## #    ##
# ## #### ## #### ##
# ##      ## ####  E
# ## #### ## #### ##
#    ####         ##
#S##################

The maze will be preset and not brought in as input. The solver should start as S and try to find a way to E. The program should mark the path it is
taking and also mark the paths that were incorrect.

The program should redraw the maze each time the solver takes a new step. In the solution, show a clean maze with a solution path that the solver found.
The program should have a main() function and at least one other function. You must also use arrays to store the maze. The masze must be solved in an
algorithm. Do not simply hardcode print statements. Use pointers for moving around the maze. Do not use subscription or indexing techniques.
*/

#include <stdio.h>
#include <windows.h>

#define FALSE 0
#define TRUE 1

#define COLS 20
#define ROWS 10

// Symbols:
// '.' = open
// '#' = wall
// 'S' = start
// 'E' = end
// '+' = path
// 'x' = bad path
char* maze[ROWS][COLS] = {
"#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#",
    "#","#",".","#",".",".",".",".",".","#","#",".",".",".",".","#","#","#",".","#",
    "#","#",".","#",".","#","#","#",".",".",".",".",".","#",".",".",".",".",".","#",
    "#",".",".","#",".","#",".","#","#","#","#","#",".","#","#","#","#","#","#","#",
    "#",".","#","#",".","#",".",".",".",".","#","#",".","#",".",".",".",".","#","#",
    "#",".","#","#",".","#","#","#","#",".","#","#",".","#","#","#","#",".","#","#",
    "#",".","#","#",".",".",".",".",".",".","#","#",".","#","#","#","#",".",".","E",
    "#",".","#","#",".","#","#","#","#",".","#","#",".","#","#","#","#",".","#","#",
    "#",".",".",".",".","#","#","#","#",".",".",".",".",".",".",".",".",".","#","#",
    "#","S","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#",
};


void display_maze(void);
int find_path(int x, int y);


int main(void)
{
display_maze();

if ( find_path(0, 0) == TRUE )
{
printf("Success!\n");
Sleep(5000);
}
else
{
printf("Failed\n");

display_maze();
}
}

void display_maze(void)
{
printf("MAZE:\n");

for (int row = 0; row < ROWS; row++ )
{
printf("\n");

for (int col = 0; col < COLS; col++)
{
printf("%s", maze[row][col]);
}
}

printf("\n");
}

int find_path(int x, int y)
{
// If x,y is outside maze, return false.
if ( x < 0 || x > 9 || y < 0 || y > 19 ) return FALSE;

// If x,y is the goal, return true.
if ( *maze[y][x] == 'E' ) return TRUE;

// If x,y is not open, return false.
if ( *maze[y][x] != '.' && *maze[y][x] != 'S' ) return FALSE;

// Mark x,y part of solution path.
*maze[y][x] = '+';

// If find_path North of x,y is true, return true.
if ( find_path(x, y - 1) == TRUE ) return TRUE;

// If find_path East of x,y is true, return true.
if ( find_path(x + 1, y) == TRUE ) return TRUE;

// If find_path South of x,y is true, return true.
if ( find_path(x, y + 1) == TRUE ) return TRUE;

// If find_path West of x,y is true, return true.
if ( find_path(x - 1, y) == TRUE ) return TRUE;

// Unmark x,y as part of solution path.
*maze[y][x] = 'x';

return FALSE;
}

Find_Path is supposed to be the function that solves the maze. It looks for a path, and when it finds one, moves to that spot and marks the spot it was at with a +. It is recursive; the function should repeat itself until it finds the exit. On the chance the function runs into a wall, it should go back to the closest + sign that has a turn and try a new path.
18
The Binary Cafe' / Re: My Final Exam
« Last post by xfixium on December 02, 2010, 03:41:24 PM »
I see your problem, your array doesn't hold separate elements.

Code: [Select]
#define COLS 20
#define ROWS 10

// Symbols:
// '.' = open
// '#' = wall
// 'S' = start
// 'E' = end
// '+' = path
// 'x' = bad path
char* maze[ROWS][COLS] = {
{"#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#"},
    {"#","#",".","#",".",".",".",".",".","#","#",".",".",".",".","#","#","#",".","#"},
    {"#","#",".","#",".","#","#","#",".",".",".",".",".","#",".",".",".",".",".","#"},
    {"#",".",".","#",".","#",".","#","#","#","#","#",".","#","#","#","#","#","#","#"},
    {"#",".","#","#",".","#",".",".",".",".","#","#",".","#",".",".",".",".","#","#"},
    {"#",".","#","#",".","#","#","#","#",".","#","#",".","#","#","#","#",".","#","#"},
    {"#",".","#","#",".",".",".",".",".",".","#","#",".","#","#","#","#",".",".","E"},
    {"#",".","#","#",".","#","#","#","#",".","#","#",".","#","#","#","#",".","#","#"},
    {"#",".",".",".",".","#","#","#","#",".",".",".",".",".",".",".",".",".","#","#"},
    {"#","S","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#","#"},
};

Then if you want to draw the data, you just iterate through the array elements and draw the characters:

Code: [Select]
void display_maze(void)
{
printf("MAZE:\n");

for (int row = 0; row < ROWS; row++ )
{
printf("\n");

for (int col = 0; col < COLS; col++)
{
std::cout << maze[row][col];
}
}

printf("\n");
}

Will get back to you on the rest....
19
The Binary Cafe' / Re: My Final Exam
« Last post by xfixium on December 02, 2010, 02:52:10 PM »
What doesn't work about it?
20
The Binary Cafe' / Re: My Final Exam
« Last post by Jeod on December 02, 2010, 01:51:23 PM »
Code: [Select]
/*
Solve the following 20x10 maze using an algorithm:

####################
##  #    ##    ### #
## # ###     #     #
#  # # ##### #######
# ## #    ## #    ##
# ## #### ## #### ##
# ##      ## ####  E
# ## #### ## #### ##
#    ####         ##
#S##################

The maze will be preset and not brought in as input. The solver should start as S and try to find a way to E. The program should mark the path it is
taking and also mark the paths that were incorrect.

The program should redraw the maze each time the solver takes a new step. In the solution, show a clean maze with a solution path that the solver found.
The program should have a main() function and at least one other function. You must also use arrays to store the maze. The masze must be solved in an
algorithm. Do not simply hardcode print statements. Use pointers for moving around the maze. Do not use subscription or indexing techniques.
*/

#include <stdio.h>
#include <iostream>

#define FALSE 0
#define TRUE 1

// Symbols:
// '.' = open
// '#' = wall
// 'S' = start
// 'E' = end
// '+' = path
// 'x' = bad path
char* maze[20][10] = {
"####################",
"##.#.....##....###.#",
"##.#.###.....#.....#",
"#..#.#.#####.#######",
"#.##.#....##.#....##",
"#.##.####.##.####.##",
"#.##......##.####..E",
"#.##.####.##.####.##",
"#....####.........##",
"#S##################"
};


void display_maze(void);
int find_path(int x, int y);


int main(void)
{
display_maze();

if ( find_path(0, 0) == TRUE )
printf("Success!\n");
else
printf("Failed\n");

display_maze();

system("pause");
}

void display_maze(void)
{
int i;

printf("MAZE:\n");
for ( i = 0; i < 20; i++ )
printf("%.*s\n", 10, maze[i]);
printf("\n");

return;
}


int find_path(int x, int y)
{
// If x,y is outside maze, return false.
if ( x < 0 || x > 9 || y < 0 || y > 19 ) return FALSE;

// If x,y is the goal, return true.
if ( *maze[y][x] == 'E' ) return TRUE;

// If x,y is not open, return false.
if ( *maze[y][x] != '.' && *maze[y][x] != 'S' ) return FALSE;

// Mark x,y part of solution path.
*maze[y][x] = '+';

// If find_path North of x,y is true, return true.
if ( find_path(x, y - 1) == TRUE ) return TRUE;

// If find_path East of x,y is true, return true.
if ( find_path(x + 1, y) == TRUE ) return TRUE;

// If find_path South of x,y is true, return true.
if ( find_path(x, y + 1) == TRUE ) return TRUE;

// If find_path West of x,y is true, return true.
if ( find_path(x - 1, y) == TRUE ) return TRUE;

// Unmark x,y as part of solution path.
*maze[y][x] = 'x';

return FALSE;
}

It doesn't work. Why?
Pages: 1 [2] 3 4 5 6 ... 10