Skip to content

Instantly share code, notes, and snippets.

View atduskgreg's full-sized avatar

Greg Borenstein atduskgreg

View GitHub Profile
// porting from here: http://felix.abecassis.me/2011/09/opencv-morphological-skeleton/
import gab.opencv.*;
import org.opencv.imgproc.Imgproc;
import org.opencv.core.Size;
import org.opencv.core.Core;
import org.opencv.core.Core.MinMaxLocResult;
import org.opencv.core.Mat;
PImage src;
This is how the communication when the engine boots can look like:
GUI engine
// tell the engine to switch to UCI mode
uci
// engine identify
id name Shredder
id author Stefan MK
@atduskgreg
atduskgreg / 200140205_agenda.md
Last active August 29, 2015 13:56
Millionaire Chess Open Call Agenda 2/5/14

Notes for Call (2/5/14)

  • Boomerange detection progress: how good is that bishop move?
  • => get "free" material on first move which leads to catastrophe later
  • => 180: Alekhine-Levenfish (ideal)
  • => maybe Rasmusson-Niemi
  • => 184: Lasker-Ragozin
  • => 176: Nielsen-Amateur (black's POV)
  • => 174: Richter-Amateur @ 3-pli
  • => important to search odd plies
// world parameters
float startForce = 2.5;
float gravity = 1;
float squash = 0.2;
float r = 50; // ball radius
PVector p;
PVector g;
PVector ball;
PVector f;
var w = 470;
var h = 235;
var startForce = 0.5;
var gravity = 0.1;
var squash = 0.2;
var p = {x:0, y:0};
var g = {x:0, y:gravity};
var f = {x:startForce, y:0};
@atduskgreg
atduskgreg / gist:8905776
Last active August 29, 2015 13:56
bounce ball shader
// fragment shader
#version 150
uniform float time;
uniform vec2 mouse;
uniform vec2 startingPosition;
uniform float gravity;
uniform vec2 initialVelocity;
uniform float ballRadius;
uniform float rebound;
require 'open3'
require 'io/wait'
require 'thread'
class Uci
attr_accessor :to
attr_accessor :from
def initialize path_to_engine
@to, @from = Open3.popen2e "/usr/local/bin/stockfish"
## Detecting Boomerang combinations
* For each Maurice boomerang example:
* Translate board positions into fen
* Tell Stockfish to set the board position (over UCI)
* Request a white move with limits on search depth (parameter)
* Play out move sequences at full search depth
* Track centipawn score (for black move) and loss of material/checkmate
* Automate this.
* Understand info line (especially what move centipawn (cp) score applies to)
* Get centipawn score for each "bestmove"
* "Graph" centipawn score for best move for white and black for series of moves after bad move
* Suggest values for boomerang outcome "threshold" (to detect a big change, i.e. loss of queen, checkmate, etc) "losing the exchange"
* Do this for more of Maurice-suggested games
import gab.opencv.*;
import processing.video.*;
import java.awt.*;
Capture video;
OpenCV opencv;
void setup() {
String[] cameras = Capture.list();