Skip to content

Instantly share code, notes, and snippets.

View victorliu's full-sized avatar

Victor Liu victorliu

View GitHub Profile
@victorliu
victorliu / hanabi.c
Last active February 14, 2022 13:19
Hanabi card game simulator
/*
Hanabi simulator
================
To use, subclass struct hanabi_player like so:
struct custom_data{
// whatever other state needed by the custom hanabi_player
};
struct hanabi_player *player = (struct hanabi_player*)malloc(sizeof(struct hanabi_player) + sizeof(struct custom_data));
@victorliu
victorliu / solver.cpp
Created August 14, 2012 03:15
Fast sudoku solver
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <set>
#include <algorithm>
// first index is which row, second is which col;
#define GRID(I,J) grid[9*(I)+(J)]
#define GET(grid,I,J) (grid)[9*(I)+(J)]