wip
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "types.h"
|
#include "types.hpp"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "types.h"
|
#include "types.hpp"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|||||||
@@ -16,4 +16,11 @@ struct Position {
|
|||||||
|
|
||||||
Position() : x(0), y(0) {}
|
Position() : x(0), y(0) {}
|
||||||
Position(int x, int y) : x(x), y(y) {}
|
Position(int x, int y) : x(x), y(y) {}
|
||||||
|
|
||||||
|
bool operator==(const Position& other) const {
|
||||||
|
return ((this->x == other.x) && (this->y == other.y));
|
||||||
|
}
|
||||||
|
bool operator!=(const Position& other) const {
|
||||||
|
return !(*this == other);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@@ -5,11 +5,16 @@
|
|||||||
|
|
||||||
using Tile = unsigned long long int;
|
using Tile = unsigned long long int;
|
||||||
|
|
||||||
void printVecOfPos(const std::vector<Position> &positions) {
|
// [debug]
|
||||||
for (const auto &pos : positions) {
|
void printVecOfPos(const std::vector<Position> &positions, int fieldSize) {
|
||||||
std::cout << pos.x << ' ' << pos.y << '\n';
|
for (int i = 0; i < fieldSize; ++i) {
|
||||||
|
for (int j = 0; j < fieldSize; ++j) {
|
||||||
|
std::cout << (std::find(positions.begin(), positions.end(), Position(i, j)) != positions.end() ? 1 : 0) << ' ';
|
||||||
|
}
|
||||||
|
std::cout << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// [debug]
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
Field field(4);
|
Field field(4);
|
||||||
|
|||||||
Reference in New Issue
Block a user