Skip to content

Commit

Permalink
Merge branch 'develop' into format_cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel1rf committed May 2, 2024
2 parents 88c2ab0 + 0f00e78 commit 07e65a8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 21 deletions.
6 changes: 3 additions & 3 deletions cpp/include/phevaluator/card_sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace card_sampler {
class CardSampler {
std::array<int, 52> deck;

public:
public:
CardSampler(void);
std::vector<int> sample(int size);
};
} // namespace card_sampler
} // namespace card_sampler

#ifdef __cplusplus
} // closing brace for extern "C"
} // closing brace for extern "C"
#endif
8 changes: 5 additions & 3 deletions cpp/src/card_sampler.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <phevaluator/card_sampler.h>
#include <array>
#include <chrono>
#include <numeric>
#include <phevaluator/card_sampler.h>
#include <random>
#include <utility>
#include <vector>
Expand All @@ -11,7 +11,9 @@ static unsigned seed =
std::chrono::system_clock::now().time_since_epoch().count();
static std::default_random_engine generator(seed);

CardSampler::CardSampler(void) { std::iota(deck.begin(), deck.end(), 0); }
CardSampler::CardSampler(void) {
std::iota(deck.begin(), deck.end(), 0);
}

std::vector<int> CardSampler::sample(int size) {
std::vector<int> ret;
Expand All @@ -25,4 +27,4 @@ std::vector<int> CardSampler::sample(int size) {
}
return ret;
}
} // namespace card_sampler
} // namespace card_sampler
10 changes: 5 additions & 5 deletions cpp/test/evaluation_plo4.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <algorithm>
#include <cstdio>
#include <phevaluator/card_sampler.h>
#include <phevaluator/phevaluator.h>
#include <phevaluator/rank.h>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>

#include "kev/kev_eval.h"
#include "gtest/gtest.h"
#include "kev/kev_eval.h"

using namespace phevaluator;

Expand All @@ -17,8 +17,8 @@ static int percentage(long long numerator, long long denominator) {

static card_sampler::CardSampler cs{};

static short IterateKevEval(int a, int b, int c, int d, int e, int f, int g,
int h, int i) {
static short
IterateKevEval(int a, int b, int c, int d, int e, int f, int g, int h, int i) {
short best = 20000;

int board[10][3] = {
Expand Down
18 changes: 13 additions & 5 deletions cpp/test/evaluation_plo5.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <algorithm>
#include <cstdio>
#include <phevaluator/card_sampler.h>
#include <phevaluator/phevaluator.h>
#include <phevaluator/rank.h>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>

#include "kev/kev_eval.h"
#include "gtest/gtest.h"
#include "kev/kev_eval.h"

using namespace phevaluator;

Expand All @@ -17,8 +17,16 @@ static int percentage(long long numerator, long long denominator) {

static card_sampler::CardSampler cs{};

static short IterateKevEval(int a, int b, int c, int d, int e, int f, int g,
int h, int i, int j) {
static short IterateKevEval(int a,
int b,
int c,
int d,
int e,
int f,
int g,
int h,
int i,
int j) {
short best = 20000;

int board[10][3] = {
Expand Down
19 changes: 14 additions & 5 deletions cpp/test/evaluation_plo6.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <algorithm>
#include <cstdio>
#include <phevaluator/card_sampler.h>
#include <phevaluator/phevaluator.h>
#include <phevaluator/rank.h>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>

#include "kev/kev_eval.h"
#include "gtest/gtest.h"
#include "kev/kev_eval.h"

using namespace phevaluator;

Expand All @@ -17,8 +17,17 @@ static int percentage(long long numerator, long long denominator) {

static card_sampler::CardSampler cs{};

static short IterateKevEval(int a, int b, int c, int d, int e, int f, int g,
int h, int i, int j, int k) {
static short IterateKevEval(int a,
int b,
int c,
int d,
int e,
int f,
int g,
int h,
int i,
int j,
int k) {
short best = 20000;

int board[10][3] = {
Expand Down

0 comments on commit 07e65a8

Please sign in to comment.