/Roguelike

🦇: Roguelike

Primary LanguageC++Boost Software License 1.0BSL-1.0


Supported Compilers 🔧

Compiler Run
MSVC None
GCC Wandbox
Clang Wandbox

Generated Image 🖼️

rl1 rl2


Example

#include "RogueLike.hpp"
#include <array>
#include <iostream>

int main() {

	using shape_t = int;
	std::array<std::array<shape_t, 32>, 24> matrix{ {} };

	dtl::shape::RogueLike<shape_t>(0, 1, 2, 3, 4, 20,
		dtl::base::MatrixRange(3, 3, 2, 2),
		dtl::base::MatrixRange(3, 3, 4, 4)).draw(matrix);

	for (const auto& i : matrix) {
		for (const auto& j : i)
			std::cout << j << ',';
		std::cout << '\n';
	}

	for (const auto& i : matrix) {
		for (const auto& j : i)
			switch (j) {
			case 0:std::cout << "%%"; break;
			case 1:std::cout << "##"; break;
			case 2:std::cout << "  "; break;
			case 3:std::cout << "++"; break;
			case 4:std::cout << "--"; break;
			}
		std::cout << '\n';
	}

	return 0;
}
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,1,0,0,1,4,1,1,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,1,0,0,1,4,4,4,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,1,0,0,1,4,1,4,1,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,1,1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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%############%%%%######%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%##        ##%%%%##--######%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%##        ##%%%%##------##%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%##        ##%%%%##--##--##%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%##########++####%%%%##--##--##%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%##----------##%%%%%%##--######%%%%%%%%%%%%
%%######################++##########%%%%%%##++########%%%%%%%%%%
%%##------------++        ##%%%%%%%%%%%%%%##        ##%%%%%%%%%%
########--########        ############%%%%##        ##%%%%%%%%%%
##--------##%%%%##        ####      ########        ##%%%%%%%%%%
######--####%%%%######++######      ++--########++####%%%%%%%%%%
%%%%##--##%%%%%%##----------++      ##------------##%%%%%%%%%%%%
%%%%##--##%%%%%%##############      ##--########--######%%%%%%%%
%%%%##--##%%%%%%%%############++######--##%%%%##------##%%%%%%%%
%%%%##--##%%%%%%%%##------------##%%##--############++####%%%%%%
%%%%##--##%%%%%%%%############--##%%######------++      ##%%%%%%
%%%%######%%%%%%%%%%%%##--------##%%%%%%######--##      ##%%%%%%
%%%%%%%%%%%%%%%%%%%%%%######--########%%##------##      ##%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%##--------##%%##########      ##%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%############%%%%%%%%%%##########%%%%%%

>> View License 💳

Copyright (c) 2018-2022 As Project.

Distributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


Related Items 🎮

PAX_SAPIENTICA DTL GenkaiSyuraku AsLib