Skip to content

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

Kasugaccho edited this page Aug 17, 2019 · 12 revisions

バージョン:0.4.0.0以降

<DTL/Shape/CellularAutomatonIsland.hpp>

namespace dtl::shape {
  template <typename T>
  class CellularAutomatonIsland;
}

T は1bit以上の型

対応機能

機能名 対応
非長方形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, 32>, 24> matrix{ {} };

	dtl::shape::CellularAutomatonIsland<shape_t>(1, 0, 5, 0.4).draw(matrix);

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

	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,1,0,0,0,0,0,1,1,1,0,1,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,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,1,1,1,1,1,0,0,0,0,0,
0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,1,1,1,1,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,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,1,0,0,0,1,1,1,1,1,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,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,1,1,1,1,1,1,0,0,
0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1,1,1,0,0,0,
0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,1,1,0,1,0,0,1,1,1,0,0,0,
0,1,1,1,1,0,0,0,0,0,1,1,1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,0,0,
0,1,1,1,0,0,0,0,0,0,1,1,0,0,1,1,1,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,
0,0,1,1,0,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,
0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,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,1,1,1,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,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,0,0,1,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,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,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,
////////////////////////////////////////////////////////////////
////////////////////##//////////######//##//////////////////////
//////////////////////////////////##//////////////////##////////
//////####////////////////////######//##//############//////////
//////####//////////####//////########################//////////
//##//////////////////////////////######//##//##########////////
////////////////////##//////////////##////################//////
////////////////////////////////////####//////############//////
////////////////////##////////////////////////##########////////
////////////////////////////////////########################////
//####////////////////////////////////##////##////########//////
////######//////////######////####//////####//##////######//////
//########//////////######//########//######//####//######//////
//######////////////####////########//########////########//////
////####////##//////######################////////##########////
//////////////////////////////////######//////////##########////
////////######//////////////////############////////########////
////////////////////////////////############////############////
////////////////////////////////##############//////////##//////
//////////////////////////////##############//////////##////////
////////////////////////////////############////////##//////////
////////////////////////////////##//##//////////////////////////
////////////////////////////////##//////////////////////////////
////////////////////////////////////////////////////////////////

画像

ri

関連項目

dtl::shape::CellularAutomatonMixIsland

Clone this wiki locally