Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 8 additions & 1 deletion backend/feature_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ def preprocess_datas(src_dir, dest_dir):
dest_fields = dest_dir.split("/")

for filename in glob.iglob(src_dir + "**/*.*", recursive=True):

if(os.path.isdir(filename)):
continue

if "/Debug/" in filename:
continue

fields = filename.split("/")

my_dir = ""
Expand Down Expand Up @@ -290,4 +297,4 @@ def add_new_line_csv(csv_file, data):
file1.write(str(nr_crt) + ",")
file1.write(data[i] + ",")

file1.write("\n")
file1.write("\n")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions data/features.csv
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,16 @@ nr_crt,label,nr_clase,nr_errors,nr_inheritance,nr_virtual,nr_static,nr_global,nr
64,student_1,32,2067,21,29,18,0,55,16,10,25,1,7,9,0,0,30,8,268,24780,53608,
65,student_69,23,3256,0,11,9,0,37,1,4,11,1,18,2,0,0,23,13,108,9366,44196,
66,student_22,21,293,8,7,8,0,44,7,0,5,1,31,0,1,0,22,12,159,11928,5823,
67,c8824b726966b3950c8d63034cce64c5,20,1113,13,69,33,0,42,4,10,4,2,26,12,2,0,20,97,180,27190,30788,
68,77200bf50036251f12443ecd6cc7a0bf,20,1113,13,69,33,0,42,4,10,4,2,26,12,2,0,20,97,180,27190,30788,
69,2cd32f227d4eec3559d84887b60b5d09,20,1113,13,69,33,0,42,4,10,4,2,26,12,2,0,20,97,180,27190,30788,
70,034e3b7103f5faf8decdf8c5e7f5db87,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
71,93117b89f3a83b69c45b2a7a1b1006ca,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
72,f2996974c656f0e792d157b02f22b0c0,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
73,89be254db206aaff66d77c2f0840d72f,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
74,363142b972be609116c0f431f22e92f6,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
75,b66dfdea2e76ce298ea049c17e6de700,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
76,7dca995c60882d80cdc0c63af871750e,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
77,44a18a80601708a28ddf0fcb8229fbb5,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
78,7a2bc01d3295b553b9ee892e80c0fdfc,23,1005,1,11,40,0,37,13,4,2,1,15,11,0,0,24,0,142,19421,26071,
79,4c68c15adecea96f85d90fb9d2c10e4c,20,1113,13,69,33,0,42,4,10,4,2,26,12,2,0,20,97,180,27190,30788,
13 changes: 13 additions & 0 deletions data/grades.csv
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,16 @@ student_70,7.3
student_71,9.55
student_72,9.6
student_73,
c8824b726966b3950c8d63034cce64c5,7.56
77200bf50036251f12443ecd6cc7a0bf,7.54
2cd32f227d4eec3559d84887b60b5d09,7.53
034e3b7103f5faf8decdf8c5e7f5db87,8.15
93117b89f3a83b69c45b2a7a1b1006ca,8.15
f2996974c656f0e792d157b02f22b0c0,7.99
89be254db206aaff66d77c2f0840d72f,7.91
363142b972be609116c0f431f22e92f6,7.85
b66dfdea2e76ce298ea049c17e6de700,7.8
7dca995c60882d80cdc0c63af871750e,7.84
44a18a80601708a28ddf0fcb8229fbb5,7.75
7a2bc01d3295b553b9ee892e80c0fdfc,7.74
4c68c15adecea96f85d90fb9d2c10e4c,7.47
1,030 changes: 1,030 additions & 0 deletions data/preprocessed/train/034e3b7103f5faf8decdf8c5e7f5db87/codying_style.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#pragma once
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

class Actiune
{
private:
string act;
int x;
int y;
public:
Actiune(string action) {
istringstream iss(action);
string buff;
do{
iss >> buff;
if (buff == "clicked") {
act = buff;
iss >> buff;
iss >> buff;
x = stoi(buff);
iss >> buff;
y = stoi(buff);
}
} while (iss);

};

string getAct() { return act; }
int getX() { return x; }
int getY() { return y; }
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#pragma once
#include "Zombie.h"

class BucketHeadZombie:virtual public Zombie
{
public:
BucketHeadZombie() {};
BucketHeadZombie(int xStart, int yStart, int xSpeed) {
m_name = "BucketHeadZombie";
m_health = 200;
damage = 20;
this->xStart = xStart;
this->xSpeed = xSpeed;
this->yStart = yStart;
UserInterface::ConsoleOutput& conOut = UserInterface::ConsoleOutput::getInstance();
conOut(xStart, yStart);
HANDLE color = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(color, 2);
cout << "B";
SetConsoleTextAttribute(color, 7);
lastMovement = steady_clock::now();
movementTime = 500;
atackTime = 500;
}

void print() override {
UserInterface::ConsoleOutput& conOut = UserInterface::ConsoleOutput::getInstance();
conOut(xStart, yStart);
HANDLE color = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(color, 2);
cout << "B";
SetConsoleTextAttribute(color, 7);
}

virtual void move() override {
UserInterface::ConsoleOutput& conOut = UserInterface::ConsoleOutput::getInstance();
conOut(xStart, yStart) << " ";
yStart -= xSpeed;
if (yStart % 5 == 0) {
yStart -= 1;
}
if (yStart % 5 == 2) {
yStart -= 1;
}
conOut(xStart, yStart);
HANDLE color = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(color, 2);
cout << "B";
SetConsoleTextAttribute(color, 7);
}

~BucketHeadZombie() {};

};

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once
#include "Plant.h"

class CherryBomb:public Plant
{
private:
static int spawnTime;
public:
CherryBomb(int x, int y) :Plant(50, 50, x, y) {
UserInterface::ConsoleOutput& conOut = UserInterface::ConsoleOutput::getInstance();
conOut(y, x);
HANDLE color = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(color, 4);
cout << (char)229;
SetConsoleTextAttribute(color, 7);
}
static int getSpawnTime() { return spawnTime; }
~CherryBomb() {};
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once
#include <windows.h>
#include <string>

namespace UserInterface {

class ConsoleInput
{
private:
HANDLE hStdin;
DWORD cNumRead, fdwMode, fdwSaveOldMode, i;
INPUT_RECORD irInBuf[128];
std::string mouseEventProc(MOUSE_EVENT_RECORD);
std::string resizeEventProc(WINDOW_BUFFER_SIZE_RECORD);
std::string keyEventProc(KEY_EVENT_RECORD);

static ConsoleInput* instance;

ConsoleInput();
ConsoleInput(const ConsoleInput&) {};
~ConsoleInput() {};

public:

static ConsoleInput& getInstance();
static void destroyInstance();
std::string getUserActions();
};
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once
#define CON_WIDTH 1280
#define CON_HEIGHT 720
#include <iostream>

namespace UserInterface{
class ConsoleOutput
{
public:
static ConsoleOutput& getInstance();
static void destroyInstance();
ConsoleOutput& operator() (int row, int col);

template <typename T>
friend ConsoleOutput& operator<< (ConsoleOutput& out, T obj)
{
std::cout << obj;
return out;
}
private:
static ConsoleOutput* instance;

ConsoleOutput();
ConsoleOutput(const ConsoleOutput&) {};
~ConsoleOutput() {};
};
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#pragma once
#include "Projectile.h"

class FrozenPea:public Projectile
{
public:
FrozenPea(int xStart, int yStart, int xSpeed) {
this->xStart = xStart;
this->xSpeed = xSpeed;
this->yStart = yStart;
m_name = "FrozenPea";
UserInterface::ConsoleOutput& conOut = UserInterface::ConsoleOutput::getInstance();
conOut(xStart, yStart);
HANDLE color = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(color, 11);
cout << (char)233;
SetConsoleTextAttribute(color, 7);
lastMovement = steady_clock::now();
}
void move() {
UserInterface::ConsoleOutput& conOut = UserInterface::ConsoleOutput::getInstance();
conOut(xStart, yStart) << " ";
yStart += xSpeed;
if (yStart % 5 == 0) {
yStart += 1;
}
if (yStart % 5 == 2) {
yStart += 1;
}
conOut(xStart, yStart);
HANDLE color = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(color, 11);
cout << (char)233;
SetConsoleTextAttribute(color, 7);
}
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#pragma once
#include "ConsoleOutput.h"
#include "ConsoleInput.h"
#include "Map.h"
#include "Sun.h";
#include "Actiune.h"
#include <chrono>
#include <time.h>
#include <vector>
#include "Player.h"
#include <fstream>
#include "SuperZombie.h"
#include "Log.h"


class Game
{
public:
static Game& getInstance();
static void destroyInstance();

static void playFirstLevel();
static void playSecondLevel();
static void playThirdLevel();

static void startZombieWave(int level, int waveNumber, int &ok);
static bool play(int minY, int maxY, int level);
private:
static Game* instance;
static string playerName;
static int currentLevel;
static Player p;

Game();
Game(const Game&) {};
~Game() {};
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
class IDrawable
{
protected:
int x;
int y;
public:
int getX() { return x; }
int getY() { return y; }
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once
class IZombie
{
public:
virtual void print() = 0;
virtual void move() = 0;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once
#include <fstream>
#include <iostream>

using namespace std;

class Log
{
public:
static Log& getInstance();
static void destroyInstance();

static void logEvent(string eveniment);
private:
static Log* instance;


Log() {
ofstream fout("log.txt");
fout <<" ";
};
Log(const Log&) {};
~Log() {};
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#pragma once
#include <iostream>
#include "PeaShooter.h"
#include "SnowPea.h"
#include "WallNut.h"
#include "SunFlower.h"
#include "CherryBomb.h"

using namespace std;
class Map
{
public:
static Map& getInstance();

void displayFirstLevel();
void displaySecondLevel();
void displayThirdLevel();
void displayShop();
private:
static Map* instance;

Map() {};
Map(const Map&) {};
~Map() {};
};

Loading