Skip to content

Commit

Permalink
fin
Browse files Browse the repository at this point in the history
  • Loading branch information
nanda-gopal-sb committed Nov 23, 2024
1 parent 6be6a1b commit ec808a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
## Work in progress- will update once its over
## Work in progress- will update once its over



# To Compile
Needs to have cmake installed
```
git clone https://github.com/nanda-gopal-sb/memory-match.git
cd memory-match
cmake -B build
cmake --build build
```
8 changes: 5 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct Cell {

std::vector<Cell> cells;

// to check for win
bool isWin() {
bool win = true;
for (auto cell : cells) {
Expand All @@ -35,7 +36,7 @@ bool isWin() {
return true;
}

sf::Font font;
// to check if the index is already accounted for
bool isInArray(int num, std::vector<int>& arr) {
for (auto nums : arr) {
if (nums == num)
Expand All @@ -47,7 +48,7 @@ bool isInArray(int num, std::vector<int>& arr) {
void fillNums() {
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> distrib(0, 63);
std::uniform_int_distribution<> distrib(0, 63); // randum number gen
int rand = -1;
std::vector<int> arr;
for (int i = 1; i <= ((ROWS * COLUMNS) / 2); i++) {
Expand All @@ -62,6 +63,7 @@ void fillNums() {
}

sf::Text DrawText() {
sf::Font font;
sf::Text text;
if (!font.loadFromFile("assests/daFont.ttf")) {
std::cout << "unable";
Expand Down Expand Up @@ -117,7 +119,7 @@ void drawRec(sf::RenderWindow& window, bool drawBlack) {
}
}
}
void text(sf::RenderWindow& window, bool fin) {
void text(sf::RenderWindow& window) {
auto text = DrawText();
text.setString("Victory is yours");
text.setPosition(0, 0);
Expand Down

0 comments on commit ec808a6

Please sign in to comment.