refactoring
This commit is contained in:
+1
-21
@@ -1,4 +1,5 @@
|
||||
|
||||
#include "../include/useful_funcs.h"
|
||||
#include <asm-generic/errno.h>
|
||||
#include <cstdlib>
|
||||
#include <errno.h>
|
||||
@@ -6,27 +7,6 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
bool AreWeInBounds(int i, int j, std::vector<std::vector<char>> &wordsearch) {
|
||||
if (i < 0 || j < 0) {
|
||||
return false;
|
||||
}
|
||||
if (i >= wordsearch.size() || j >= wordsearch[i].size()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int conditional_operation(int a, int b, char op) {
|
||||
switch (op) {
|
||||
case '+':
|
||||
return a + b;
|
||||
case '-':
|
||||
return a - b;
|
||||
default:
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
int Check(std::vector<std::vector<char>> &wordsearch, int i, int j) {
|
||||
int xmases = 0;
|
||||
char op_i;
|
||||
|
||||
+1
-22
@@ -1,36 +1,15 @@
|
||||
|
||||
#include "../include/useful_funcs.h"
|
||||
#include <asm-generic/errno.h>
|
||||
#include <cstdlib>
|
||||
#include <errno.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#define RANGE 1
|
||||
|
||||
int res;
|
||||
|
||||
bool AreWeInBounds(int i, int j, std::vector<std::vector<char>> &wordsearch) {
|
||||
if (i < 0 || j < 0) {
|
||||
return false;
|
||||
}
|
||||
if (i >= wordsearch.size() || j >= wordsearch[i].size()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int conditional_operation(int a, int b, char op) {
|
||||
switch (op) {
|
||||
case '+':
|
||||
return a + b;
|
||||
case '-':
|
||||
return a - b;
|
||||
default:
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
int Check(std::vector<std::vector<char>> &wordsearch, int i, int j) {
|
||||
int xmases = 0;
|
||||
char op_i;
|
||||
|
||||
Reference in New Issue
Block a user