<commit_before>#ifndef VIRTUALMAZE_CPP
#define VIRTUALMAZE_CPP

/*
 * VirtualMaze is used to render the maze on screen it
 * contains Rectangles that draw walls and inherits
 * MazeMap which is what the robot will use to keep
 * track of where it is
 */

#include <GL/gl.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <vector>
using namespace std;


#include "define.h"
#include "Rectangle.h"

extern "C" {
	#include "logic/MazeMap.h"
}

#include "VirtualMaze.h"
//
// constructors
//

VirtualMaze::VirtualMaze() {
	mazeMap = mazemap_create();
	robotMazeMap = NULL;

	// perform prim generation
	primGeneration();

	// init the circle memory
	circles = new Circle*[MAZE_WIDTH * MAZE_HEIGHT];
	for (int row = 0; row < MAZE_WIDTH; row++) {
		for (int col = 0; col < MAZE_HEIGHT; col++) {
			int arrayPos = row * MAZE_WIDTH + col;
			circles[arrayPos] = new Circle(row * blockWidthPX, col * blockWidthPX, wallWidthPX/2);
		}
	}
}

//
// main methods
//

// draws the maze
void VirtualMaze::draw() {

	// draw every wall in the wall list
	for (unsigned int n = 0; n < walls.size(); n++) {
		Wall wall = walls[n];
		int row = wall.row;
		int col = wall.col;

		// check if the robot has seen the wall
		BOOL robotSeesWall = FALSE;
		if (wall.isHorizontal && robotMazeMap->horizWalls[row][col]) {
			robotSeesWall = TRUE;
		}
		if (!wall.isHorizontal && robotMazeMap->vertWalls[row][col]) {
			robotSeesWall = TRUE;
		}

		// if robot has scanned the map, draw as white
		float c = 0.5f;
		if (robotSeesWall) {
			c = 1.0f;
		}

		wall.rectangle.draw(c, c, c);
	}

	// set the draw color to white
	glColor3f(1.0f, 1.0f, 1.0f);

	// draw every circle
	for (int n = 0; n < (MAZE_WIDTH * MAZE_HEIGHT); n++) {
		circles[n]->draw();
	}
}
<commit_msg>changed invisible wall to .25f color easier to tell the difference between discovered and undiscovered walls<commit_after>#ifndef VIRTUALMAZE_CPP
#define VIRTUALMAZE_CPP

/*
 * VirtualMaze is used to render the maze on screen it
 * contains Rectangles that draw walls and inherits
 * MazeMap which is what the robot will use to keep
 * track of where it is
 */

#include <GL/gl.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <vector>
using namespace std;


#include "define.h"
#include "Rectangle.h"

extern "C" {
	#include "logic/MazeMap.h"
}

#include "VirtualMaze.h"
//
// constructors
//

VirtualMaze::VirtualMaze() {
	mazeMap = mazemap_create();
	robotMazeMap = NULL;

	// perform prim generation
	primGeneration();

	// init the circle memory
	circles = new Circle*[MAZE_WIDTH * MAZE_HEIGHT];
	for (int row = 0; row < MAZE_WIDTH; row++) {
		for (int col = 0; col < MAZE_HEIGHT; col++) {
			int arrayPos = row * MAZE_WIDTH + col;
			circles[arrayPos] = new Circle(row * blockWidthPX, col * blockWidthPX, wallWidthPX/2);
		}
	}
}

//
// main methods
//

// draws the maze
void VirtualMaze::draw() {

	// draw every wall in the wall list
	for (unsigned int n = 0; n < walls.size(); n++) {
		Wall wall = walls[n];
		int row = wall.row;
		int col = wall.col;

		// check if the robot has seen the wall
		BOOL robotSeesWall = FALSE;
		if (wall.isHorizontal && robotMazeMap->horizWalls[row][col]) {
			robotSeesWall = TRUE;
		}
		if (!wall.isHorizontal && robotMazeMap->vertWalls[row][col]) {
			robotSeesWall = TRUE;
		}

		// if robot has scanned the map, draw as white
		float c = 0.25f;
		if (robotSeesWall) {
			c = 1.0f;
		}

		wall.rectangle.draw(c, c, c);
	}

	// set the draw color to white
	glColor3f(1.0f, 1.0f, 1.0f);

	// draw every circle
	for (int n = 0; n < (MAZE_WIDTH * MAZE_HEIGHT); n++) {
		circles[n]->draw();
	}
}

{'fraction_non_alphanumeric': 0.13681592039800994, 'fraction_numerical': 0.009673852957435046, 'mean_word_length': 3.3445378151260505, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '4598787', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1351, 'n_words': 405}