Skip to content

Instantly share code, notes, and snippets.

View thai-ng's full-sized avatar

Thai Nguyen thai-ng

View GitHub Profile
#include "drawable.h"
#include <SDL/SDL.h>
class SDLDrawable : public Drawable
{
public:
SDLDrawable(int w, int h);
~SDLDrawable();
void setPixel(int x, int y, unsigned int color);
unsigned int getPixel(int x, int y);
@thai-ng
thai-ng / angle.cpp
Last active March 5, 2017 02:58
count number of viewable points
#include <vector>
#include <cmath>
#include <algorithm>
struct Point
{
int x;
int y;
};
@thai-ng
thai-ng / matrix.hpp
Created February 25, 2017 01:52
Compile time matrix
#pragma once
#include <array>
template <int width, int height, typename T>
class Matrix
{
using row_t = std::array<T, width>;
using col_t = std::array<T, height>;
public:
@thai-ng
thai-ng / Maze.cpp
Last active February 16, 2017 03:22
Recursive Division Maze Generator
#include <iostream>
#include <vector>
#include <random>
#include <chrono>
enum class TileStatus
{
Visited,
Wall,
NotVisited