Skip to content

Instantly share code, notes, and snippets.

View jonbrennecke's full-sized avatar

Jon Brennecke jonbrennecke

View GitHub Profile
@jonbrennecke
jonbrennecke / Pente.js
Created May 4, 2014 18:31
WIP implementation of Pente in JS
var board = [
[ 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 'X', 'X', 'X', 'X', 'X', 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0 ]
];
@jonbrennecke
jonbrennecke / Pente.cpp
Created May 4, 2014 18:28
Game of Pente implementation in C++11
// compile with -std=c++11
//
// @author jonbrennecke / https://github.com/jonbrennecke
#include <iostream>
#include <vector>
#include <regex>
#include <string>
/**
% Estimate the power spectra of a signal using Bartlett's Method, or, if parameter 'overlap' is specified, using Welch's Method.
% This method is based on the concept of using periodogram spectrum estimates, which are the result of converting a signal from the
% time domain to the frequency domain.
%
% @see Bartlett, M.S. (1948). "Smoothing Periodograms from Time-Series with Continuous Spectra". Nature 161: 686–687.
% @see Welch, P.D. (1967) "The Use of Fast Fourier Transform for the Estimation of Power Spectra: A Method Based on
% Time Averaging Over Short, Modified Periodograms", IEEE Transactions on Audio Electroacoustics, AU-15, 70–73.
%
% @link http://en.wikipedia.org/wiki/Bartlett%27s_method
% @link http://en.wikipedia.org/wiki/Welch_method