Skip to content

SampleCode

Kasugaccho edited this page Apr 6, 2019 · 5 revisions

Source Code

#include <DTL.hpp>
#include <cstddef>
#include <cstdint>
#include <array>

int main() {

	using shape_t = std::uint_fast8_t;
	constexpr std::size_t width{ 16 };
	constexpr std::size_t height{ 8 };

	std::array<std::array<shape_t, width>, height> matrix{ {} };

	dtl::shape::Border<shape_t>(1).draw(matrix);

	dtl::console::OutputStringBool<shape_t>("#", "/").draw(matrix);

}

Output Result

################
#//////////////#
#//////////////#
#//////////////#
#//////////////#
#//////////////#
#//////////////#
################

0.1.X

#include <array>
#include "DTL.hpp"

int main() {

	using dungeon_t = std::uint_fast8_t;
	std::array<std::array<dungeon_t, 11>, 11> dungeon{ {} };

	dtl::PointGridField<dungeon_t> point_grid_field(dungeon);
	dtl::dungeonStringOutputBool(dungeon, "##", "  ");

	return 0;
}
######################
##                  ##
##  ##  ##  ##  ##  ##
##                  ##
##  ##  ##  ##  ##  ##
##                  ##
##  ##  ##  ##  ##  ##
##                  ##
##  ##  ##  ##  ##  ##
##                  ##
######################

LICENSE

CC0

Clone this wiki locally