Skip to content

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

Kasugaccho edited this page Aug 17, 2019 · 10 revisions

バージョン:0.4.3.1以降

<DTL/Shape/FractalIsland.hpp>

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

T は4bit以上の型

対応機能

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

	dtl::shape::FractalIsland<shape_t>(10, 150, 75).draw(matrix);

	dtl::console::OutputNumber<shape_t>(",").draw(matrix);
	dtl::console::OutputStringBool<shape_t>("##", "//").drawOperator(matrix, [](const shape_t value_) {return value_ > 60; });

	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,3,7,10,7,10,6,6,5,15,11,9,5,14,11,8,5,10,12,12,11,12,15,16,6,12,11,19,13,18,8,13,2,7,9,14,5,10,4,12,4,3,3,8,2,9,2,9,
0,7,14,14,15,13,13,11,10,16,22,16,11,16,22,16,10,17,25,23,22,26,30,21,13,17,22,24,26,21,16,10,5,11,18,14,11,9,9,8,8,7,7,5,5,4,5,2,
0,6,14,22,22,19,18,23,15,22,21,21,16,23,21,17,15,29,28,31,33,37,32,32,19,31,30,36,39,30,23,14,7,13,17,22,16,19,13,13,12,17,9,15,7,10,4,6,
0,7,15,22,30,27,25,22,21,20,21,21,23,21,21,20,21,26,32,38,44,39,35,30,26,32,39,45,52,41,31,20,10,13,16,19,22,20,19,17,17,14,13,11,10,7,5,2,
0,14,18,22,27,35,30,31,25,28,25,28,27,36,31,30,25,38,38,48,44,48,44,36,32,34,39,51,48,44,29,20,12,20,24,31,23,29,21,27,20,20,19,21,11,9,7,6,
0,11,23,23,25,30,36,33,31,30,30,31,32,37,43,36,31,37,45,44,45,49,54,46,39,39,41,42,44,36,29,21,15,23,33,28,24,24,25,24,25,25,26,19,13,11,11,5,
0,8,16,21,22,27,33,40,36,35,36,38,37,46,42,37,36,47,44,46,45,54,51,51,45,51,42,44,40,42,28,28,17,29,27,30,25,30,27,33,29,31,25,24,14,11,9,5,
0,5,10,15,21,25,31,36,43,42,42,42,42,42,42,42,43,43,44,45,47,47,49,50,52,48,44,40,36,32,28,24,20,21,23,24,27,28,30,32,34,29,25,20,17,12,8,4,
0,13,16,23,21,28,30,41,42,45,48,53,49,50,48,51,47,54,54,55,57,65,60,63,53,60,52,52,44,46,40,31,22,29,27,33,30,34,33,32,32,34,30,32,23,26,17,9,
0,11,22,22,23,26,31,36,42,48,55,55,56,55,54,53,53,58,64,66,68,70,72,63,54,57,60,56,52,52,52,38,25,28,33,33,34,35,36,33,30,33,36,33,30,28,27,13,
0,10,17,25,24,29,32,41,42,52,55,61,63,63,60,60,58,67,70,81,79,78,72,67,55,64,61,68,60,56,50,45,27,37,34,41,38,39,35,35,28,30,35,43,37,31,24,15,
0,6,13,19,27,30,34,38,42,49,56,63,70,68,67,65,64,70,77,83,91,81,73,64,57,59,62,65,68,58,49,39,30,33,36,39,42,38,34,30,27,30,35,39,45,33,22,11,
0,15,18,27,24,37,39,41,42,48,57,69,68,73,76,77,69,77,80,84,86,85,74,73,57,63,62,66,63,64,54,49,32,39,35,41,39,43,36,28,24,36,36,40,35,29,24,12,
0,12,25,23,23,33,45,43,42,50,58,62,67,76,87,80,75,79,85,83,82,79,77,67,59,60,63,60,59,59,61,47,35,34,34,35,36,37,38,30,23,30,39,32,27,26,26,13,
0,13,17,18,21,28,37,44,42,47,55,59,65,73,80,85,80,80,82,84,78,74,72,73,60,62,59,59,54,59,52,44,37,34,34,39,33,31,31,26,21,28,26,27,18,18,15,7,
0,5,10,15,21,25,31,36,43,47,53,58,64,69,75,80,86,83,80,77,74,71,68,65,63,59,56,53,51,47,45,42,40,37,35,32,30,27,25,22,20,17,15,12,10,7,5,2,
0,8,15,27,27,37,39,41,42,51,58,64,66,74,77,87,85,86,82,83,79,78,77,75,64,64,65,60,56,62,57,56,44,47,46,40,37,39,37,36,26,28,24,25,18,20,14,7,
0,10,20,27,34,41,48,45,43,53,65,66,69,74,80,82,84,84,84,84,85,85,86,76,67,70,74,68,63,66,70,59,48,53,58,51,44,47,50,41,33,33,34,30,26,25,24,12,
0,11,22,34,41,47,47,50,43,51,61,66,71,74,79,83,83,85,86,95,90,92,85,81,69,78,74,76,69,67,68,63,52,57,57,58,51,54,51,48,39,43,39,35,34,27,22,19,
0,12,24,36,48,47,46,45,45,51,59,66,74,76,78,80,83,85,89,92,96,90,84,78,73,73,74,75,76,71,66,61,56,56,57,57,59,55,52,49,46,45,44,43,43,31,21,10,
0,14,25,34,42,49,47,53,45,55,65,68,71,78,77,81,81,85,88,95,92,93,91,83,75,85,81,86,76,82,76,72,60,63,67,71,61,69,63,62,52,49,49,44,40,36,28,22,
0,13,26,31,36,42,48,47,46,59,72,70,69,72,77,78,81,84,88,88,89,93,98,88,78,83,88,82,77,81,86,75,64,71,79,71,65,69,74,66,59,56,54,46,39,37,36,18,
0,15,19,30,30,40,42,46,47,63,64,67,66,70,74,85,80,90,84,90,85,87,90,90,81,83,84,85,77,77,80,77,68,79,75,75,68,75,73,70,65,60,54,49,37,35,27,17,
0,6,12,18,24,30,36,42,48,52,56,60,64,68,72,76,80,80,81,81,82,82,83,83,84,82,81,79,78,76,75,73,72,72,72,72,72,72,72,72,73,63,54,45,36,27,18,9,
0,10,13,22,24,38,43,51,46,53,59,66,70,72,75,76,79,90,86,88,90,90,93,96,84,92,85,90,88,86,87,88,76,77,79,82,80,83,79,76,69,70,59,52,39,34,26,20,
0,7,15,19,24,37,50,47,45,53,62,69,77,77,78,78,78,85,93,95,99,101,104,94,85,87,91,94,99,99,101,90,80,83,87,87,88,87,86,76,67,65,64,53,42,38,34,17,
0,13,13,24,24,36,41,48,43,58,64,78,83,82,80,85,77,88,94,104,107,112,102,101,85,96,96,105,109,107,102,96,84,89,91,98,96,94,84,72,64,65,59,56,45,38,29,14,
0,6,12,18,25,28,33,37,42,54,66,78,91,86,83,79,77,86,96,106,117,108,101,93,86,94,103,111,120,112,104,96,88,92,96,100,105,93,83,72,62,58,55,51,48,36,24,12,
0,10,19,24,22,35,35,40,40,53,61,74,81,87,79,77,75,85,96,108,107,105,101,100,86,98,101,110,114,118,111,106,92,99,100,100,97,94,80,76,59,59,55,53,42,40,23,19,
0,13,26,23,21,29,39,38,39,47,57,64,72,74,76,75,75,85,97,97,98,100,103,94,87,93,101,104,108,113,118,107,96,100,105,97,91,84,79,67,57,56,57,46,37,29,22,11,
0,9,17,22,19,27,32,34,37,45,50,56,63,74,70,71,74,82,86,94,89,96,93,90,87,98,96,104,102,113,109,109,100,102,97,94,84,82,71,63,54,51,47,39,31,28,17,12,
0,4,9,13,18,22,27,31,37,40,45,49,55,59,64,69,74,75,77,78,81,82,84,86,89,90,92,94,96,98,100,102,104,97,91,84,78,71,65,58,52,45,39,32,26,19,13,6,
0,6,12,22,19,28,30,36,38,48,53,62,61,71,72,77,69,78,82,83,81,85,88,96,91,101,104,110,102,106,100,100,97,94,86,84,77,76,67,61,50,48,40,37,28,25,21,10,
0,8,17,18,21,27,35,37,40,51,62,65,69,74,80,72,64,76,88,85,83,87,93,93,95,105,116,112,108,104,101,95,91,86,82,79,76,73,70,59,49,45,43,36,31,30,30,15,
0,15,14,21,22,28,34,45,42,54,63,77,76,81,74,73,59,73,79,85,84,95,93,102,98,107,113,115,114,106,99,95,84,88,79,79,75,73,65,61,47,50,41,40,33,34,24,15,
0,6,12,18,25,29,34,39,44,54,64,74,84,76,69,61,55,62,70,78,87,90,94,98,102,106,111,115,121,109,99,88,78,77,76,75,75,67,60,53,47,43,41,38,36,27,18,9,
0,12,15,22,24,40,42,50,46,61,61,73,74,74,63,60,49,65,67,81,83,97,99,104,105,106,108,112,111,106,97,89,71,69,69,73,67,62,55,56,45,46,41,37,32,32,22,14,
0,9,18,21,25,37,50,49,48,53,58,61,64,61,58,51,45,54,64,72,81,92,104,106,109,107,107,104,102,99,97,80,65,63,62,61,60,55,50,47,44,43,42,35,28,27,27,13,
0,15,15,21,25,39,44,47,50,52,53,57,54,59,49,50,40,52,60,72,78,96,100,111,112,109,103,103,93,90,82,75,58,62,55,56,53,53,47,49,43,39,36,35,24,21,18,9,
0,6,13,19,26,32,39,45,53,50,48,46,44,42,40,38,37,46,56,66,76,86,96,106,116,108,100,92,84,76,68,60,52,50,49,47,47,45,44,43,42,36,31,25,21,15,10,5,
0,11,16,22,28,38,36,39,45,50,49,47,46,46,38,38,31,43,56,65,74,85,89,102,101,101,94,94,82,79,68,62,45,52,45,50,42,46,44,43,36,33,28,27,22,19,16,15,
0,10,20,25,31,32,34,36,39,44,50,49,48,42,37,31,27,41,56,64,72,77,82,84,87,87,89,84,80,74,69,53,39,40,43,40,39,41,44,37,31,28,27,25,24,23,23,11,
0,12,19,33,33,31,32,34,32,37,44,46,50,47,35,30,22,42,49,61,70,73,72,77,72,79,77,77,78,72,59,47,32,37,35,37,35,40,35,31,25,27,25,28,26,28,18,9,
0,9,18,27,36,33,31,28,26,32,39,45,53,43,35,26,18,30,43,55,68,65,63,60,58,62,67,71,76,63,51,38,26,27,29,30,33,29,26,23,21,22,24,26,29,21,14,7,
0,12,18,23,27,30,22,24,19,31,33,40,39,40,30,26,13,26,37,43,51,53,50,53,43,53,51,59,57,52,46,31,19,31,28,28,24,30,25,24,15,22,20,20,21,26,17,16,
0,9,18,18,18,16,15,13,13,20,28,27,26,26,26,17,9,20,33,33,34,36,39,33,29,32,36,37,38,40,42,27,13,20,28,22,16,20,24,17,10,13,16,15,14,17,20,10,
0,5,9,15,9,7,7,14,6,15,14,14,13,17,13,14,4,18,16,18,17,25,19,22,14,21,18,26,19,27,21,13,6,15,14,18,8,10,12,9,5,10,8,7,7,15,10,12,
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////##//##////////////////////////////////////////////////
////////////////////////////////////############////////////////////////////////////////////////
//////////////////////######//////##############//######////////////////////////////////////////
//////////////////////##########################////######//////////////////////////////////////
//////////////////////##########################//##########////////////////////////////////////
//////////////////////##########################////##//////##//////////////////////////////////
////////////////////////########################//##////////////////////////////////////////////
////////////////////////##########################//////////////////////////////////////////////
//////////////////////################################////##////////////////////////////////////
////////////////////##########################################//////////////////////////////////
////////////////////############################################////////////////////////////////
//////////////////////##########################################////////////////////////////////
////////////////////############################################//##############////////////////
////////////////////############################################################////////////////
//////////////////################################################################//////////////
////////////////////////############################################################////////////
//////////////////////##############################################################////////////
////////////////////##################################################################//////////
////////////////////################################################################////////////
////////////////////##############################################################//////////////
////////////////////############################################################////////////////
//////////////////////##########################################################////////////////
////////////////////////########################################################////////////////
////////////////////////////##################################################//////////////////
//////////////////////##########################################################////////////////
////////////////////##########################################################//////////////////
////////////////////############//##############################################////////////////
////////////////////############//##########################################////////////////////
//////////////////############////##########################################////////////////////
//////////////////////######////////####################################////////////////////////
//////////////////////////////////////##########################//##////////////////////////////
//////////////////////////////////////########################//////////////////////////////////
//////////////////////////////////////##########################////////////////////////////////
//////////////////////////////////////########################//////////////////////////////////
//////////////////////////////////////######################////////////////////////////////////
////////////////////////////////////////######////##########////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////

画像

chunk

関連項目

dtl::shape::FractalLoopIsland

Clone this wiki locally