Skip to content

Instantly share code, notes, and snippets.

@mchesser
mchesser / sudoku.mzn
Created January 14, 2015 00:48
Sudoku Solver
include "globals.mzn";
% The square of the size of the board (3 in a "regular" Sudoku)
int: S;
int: N = S*S;
% An array of hints, using 0 for cells for which we don't have any hints.
array[int,int] of int: start;
% Variables (one variable per cell representing the number to be put in the cell)
@mchesser
mchesser / main.cpp
Created October 18, 2014 11:19
Magic
int main() {
int power = 8;
double val = log(power) / log(2); // = 3
int a = val;
int b = floor(val);
int c = log(8) / log(2);
int d = log(power) / log(2);
int e = floor(log(power) / log(2));