Skip to content

Instantly share code, notes, and snippets.

#include <cstdio>
#include <ctime>
#include <omp.h>
#include <cstdlib>
#include <chrono>
#include <random>
using namespace std;
int main() {
@rchoudhary
rchoudhary / minesweeper_bm.cpp
Created November 9, 2018 16:21
Benchmark of some simple minesweeper code
#include <benchmark/benchmark.h>
#include <random>
#include <cstdio>
#include <queue>
static const int MINE = -1;
static const int NUM_MINES = 10000;
struct Cell {
int value;
@rchoudhary
rchoudhary / random.cpp
Created October 29, 2018 07:51
An experiment with random number generation
#include <cstdio>
#include <random>
#include <algorithm>
#include <chrono>
int getRandNum_Old() {
static bool init = false;
if (!init) {
std::srand(time(nullptr)); // Seed std::rand
init = true;