Skip to content

dtl::shape::MazeBar (形状クラス)

Kasugaccho edited this page Oct 13, 2019 · 4 revisions

バージョン:0.4.14.0以降

<DTL/Shape/MazeBar.hpp>

namespace dtl::shape {
  template <typename T, typename Random_Engine = DTL_RANDOM_DEFAULT_RANDOM>
  class MazeBar;
}

T は1bit以上の型

Random_Engineは乱数生成クラス (デフォルトでDTL_RANDOM_DEFAULT_RANDOMが入っている)

対応機能

機能名 対応
非長方形Matrix 不可

例 (C++11)

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

int main() {

	using shape_t = std::uint_fast8_t;
	std::array<std::array<shape_t, 21>, 15> matrix{ {} };

	dtl::shape::MazeBar<shape_t>(0,	1).draw(matrix);

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

	return 0;
}

出力

1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,
1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,1,1,
1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,
1,0,1,1,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,
1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,
1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,0,1,1,1,
1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,
1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,
1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,
1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,0,1,1,1,
1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,
1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,
1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
##########################################
##//##//##//////##//////////##//////////##
##//##//##//######//######//##//##########
##//////////////////##//////////////////##
##//##############//##//##//##############
##//////##//////////##//##//////////////##
##//##################//######//##//######
##//////////##//////////##//////##//////##
##//##########//######################//##
##//////////##//////////##//////////////##
##//##########//##//##########//##//######
##//##//////////##//////##//////##//////##
##//##//##########//##########//##//######
##//##//##//////////////##//////##//////##
##########################################

画像

maze_bar

関連項目

dtl::shape::MazeDig

dtl::shape::ClusteringMaze

dtl::cuboid::MazeDig3D

Clone this wiki locally