<commit_before>#ifndef MAZEMAP_CPP
#define MAZEMAP_CPP

#include <stdlib.h>

#include "define.h"
#include "MazeMap.h"

MazeMap* mazemap_create() {
	MazeMap* mm = (MazeMap*)calloc(1, sizeof(MazeMap));

	return mm;
}

BOOL mazemap_does_wall_exist(MazeMap* mazeMap, int x, int y, Direction direction) {
	// get the wall from wall list
	int xLook, yLook;
	BOOL success = mazemap_get_look_position(x, y, direction, &xLook, &yLook);

	// if the look position was out of bounds, there is a wall
	if (!success) {
		return TRUE;
	}

	// only return TRUE if we know the wall actually exists
	if (direction == NORTH || direction == SOUTH) {
		return mazeMap->horizWalls[yLook][xLook];
	}
	else {
		return mazeMap->vertWalls[yLook][xLook];
	}
}

// sets the desired wall to a new state
void mazemap_set_wall(MazeMap* mazeMap, BOOL state, int x, int y, Direction direction) {
	// get the proper look
	int xLook, yLook;
	BOOL success = mazemap_get_look_position(x, y, direction, &xLook, &yLook);

	if (!success) {
		return;
	}

	// assign to the proper array
	if (direction == NORTH || direction == SOUTH) {
		mazeMap->horizWalls[yLook][xLook] = state;
	}
	else {
		mazeMap->vertWalls[yLook][xLook] = state;
	}
}

BOOL mazemap_get_look_position(int x, int y, Direction direction, int* xLook, int* yLook) {
	// derive the look position from the current position and direction
	switch (direction) {
	case NORTH:
	case EAST:
		*xLook = x;
		*yLook = y;
		break;
<commit_msg>added clarification comment<commit_after>#ifndef MAZEMAP_CPP
#define MAZEMAP_CPP

#include <stdlib.h>

#include "define.h"
#include "MazeMap.h"

MazeMap* mazemap_create() {
	MazeMap* mm = (MazeMap*)calloc(1, sizeof(MazeMap));

	return mm;
}

BOOL mazemap_does_wall_exist(MazeMap* mazeMap, int x, int y, Direction direction) {
	// get the wall from wall list
	int xLook, yLook;
	BOOL success = mazemap_get_look_position(x, y, direction, &xLook, &yLook);

	// if the look position was out of bounds, there is a wall
	if (!success) {
		return TRUE;
	}

	// only return TRUE if we know the wall actually exists
	if (direction == NORTH || direction == SOUTH) {
		return mazeMap->horizWalls[yLook][xLook];
	}
	else {
		return mazeMap->vertWalls[yLook][xLook];
	}
}

// sets the desired wall to a new state
void mazemap_set_wall(MazeMap* mazeMap, BOOL state, int x, int y, Direction direction) {
	
	// get the proper array position, will return false if the value is out of bounds
	int xLook, yLook;
	BOOL success = mazemap_get_look_position(x, y, direction, &xLook, &yLook);

	if (!success) {
		return;
	}

	// assign to the proper array
	if (direction == NORTH || direction == SOUTH) {
		mazeMap->horizWalls[yLook][xLook] = state;
	}
	else {
		mazeMap->vertWalls[yLook][xLook] = state;
	}
}

BOOL mazemap_get_look_position(int x, int y, Direction direction, int* xLook, int* yLook) {
	// derive the look position from the current position and direction
	switch (direction) {
	case NORTH:
	case EAST:
		*xLook = x;
		*yLook = y;
		break;

{'fraction_non_alphanumeric': 0.11876881900301103, 'fraction_numerical': 0.0006691201070592171, 'mean_word_length': 4.209059233449477, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1928931', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1112, 'n_words': 337}