From c11384df59254181fe5072d0a928fb0d4a1ddb04 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Mon, 2 Dec 2024 08:11:47 -0500 Subject: [PATCH] Forgot the little matrix wrapper. --- README.md | 28 +++++++++++++++++++++++++++- matrix.hpp | 14 ++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 matrix.hpp diff --git a/README.md b/README.md index 84d22f0..1c8d9b4 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,33 @@ See? That's how Free Speech works. You don't need a LICENSE. ## Build Instructions -Coming soon, but I do know it builds on OSX and Linux. I primarily work on Windows. +Pre-requisites: + +* Meson -- which need Python +* C++ Compiler -- Tested with Clang and G++ +* GNU make -- For the convenience Makefile + +Windows instructions + +```shell +git clone https://git.learnjsthehardway.com/learn-code-the-hard-way/roguish.git + +cd roguish +# ignore the errors the first time +./scripts/reset_build.ps1 + +# first compile takes a while +make + +# will play a sound and open windows +make test + +# this copies the binary so you can run it +make run +``` + + + ## OSX Build Notes diff --git a/matrix.hpp b/matrix.hpp new file mode 100644 index 0000000..b34270f --- /dev/null +++ b/matrix.hpp @@ -0,0 +1,14 @@ +#pragma once +#include + +typedef std::vector MatrixRow; +typedef std::vector Matrix; + +/* + * Just a quick thing to reset a matrix to a value. + */ +inline void matrix_assign(Matrix &out, int new_value) { + for(auto &row : out) { + row.assign(row.size(), new_value); + } +}