This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
physx::PxVec3* pPxVerts = new physx::PxVec3[list.vertexCount]; | |
for (int i = 0; i < list.vertexCount; i++) | |
{ | |
ConvertPosToPhysX(list.pVerts[i], pPxVerts[i]); | |
} | |
physx::PxU32* pPxIndices = new physx::PxU32[list.triangleCount * 3]; | |
for (int i = 0; i < list.triangleCount * 3; ++i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctime> | |
#include <iostream> | |
int is_morning_good() { | |
const time_t now_seconds = time(NULL); | |
struct tm now; | |
localtime_r(&now_seconds, &now); | |
return (now.tm_hour < 12); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST(RandomPolicy, Mulligan) | |
{ | |
for (int i = 0; i < 100; ++i) | |
{ | |
GameConfig config; | |
config.player1Class = CardClass::ROGUE; | |
config.player2Class = CardClass::PALADIN; | |
config.startPlayer = PlayerType::RANDOM; | |
config.doShuffle = false; | |
config.doFillDecks = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <chrono> | |
#include <condition_variable> | |
#include <iostream> | |
#include <mutex> | |
#include <thread> | |
using namespace std::chrono_literals; | |
int Func() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file is a "Hello, world!" in C++ language by GCC for wandbox. | |
#include <iostream> | |
#include <regex> | |
int main() | |
{ | |
std::regex attackRegex("\\+([[:digit:]]+) Attack"); | |
std::string text = "Raid Leader is granting this minion +1 Attack"; | |
std::smatch values; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Tensor = Tensor<float>; | |
Graph g; | |
auto& input = g.Input(TensorShape(64, 32)); | |
auto& oneHot = g.Reshape(input, TensorShape(1, 2048)); | |
auto& output = g.DropOut(oneHot, 10); | |
auto& answer = g.Max(result); | |
for (int i = 0; i < trainNum; ++i) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <random> | |
#include <iostream> | |
class Rand | |
{ | |
public: | |
Rand() | |
{ | |
m_generator.seed(m_device()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <variant> | |
struct Fluid { }; | |
struct LightItem { }; | |
struct HeavyItem { }; | |
struct FragileItem { }; | |
struct GlassBox { }; | |
struct CardboardBox { }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline std::tuple<size_t, size_t> ParseValueRangeFromString(std::string str, | |
bool& isValid) | |
{ | |
std::regex reValueRange("([[:digit:]]+)(-[[:digit:]]+)?"); | |
std::smatch values; | |
size_t minValue = 0, maxValue = std::numeric_limits<size_t>::max(); | |
if (!str.empty()) | |
{ | |
if (std::regex_match(str, values, reValueRange)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************* | |
> File Name: Enums.h | |
> Project Name: Hearthstone++ | |
> Author: Chan-Ho Chris Ohk | |
> Purpose: Enumerations for card data. | |
> Created Time: 2017/08/11 | |
> Copyright (c) 2017, Chan-Ho Chris Ohk | |
*************************************************************************/ | |
#ifndef HEARTHSTONEPP_ENUMS_H | |
#define HEARTHSTONEPP_ENUMS_H |