Skip to content

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

Kasugaccho edited this page Aug 17, 2019 · 8 revisions

バージョン:0.4.2.0以降

<DTL/Shape/DiamondSquareAverageCornerIsland.hpp>

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

T は4bit以上の型

対応機能

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

概要

DiamondSquareAverageCornerIslandとは "Matrixの描画範囲にダイヤモンドスクエア法に従って描画値を設置する" 機能を持つクラスである。

描画範囲の全てを必ず塗りつぶすとは限らない (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, 33>, 33> matrix{ {} };

	dtl::shape::DiamondSquareAverageCornerIsland<shape_t>(20, 80, 60).draw(matrix);

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

	return 0;
}

出力

100,97,95,92,90,87,85,82,81,77,75,72,71,68,66,64,63,59,57,54,53,50,48,46,44,41,39,36,35,32,30,28,26,
99,97,95,93,92,88,87,83,81,80,78,74,72,69,67,64,63,62,59,58,56,56,53,50,48,46,43,39,38,37,35,32,27,
98,97,96,95,95,92,91,86,83,82,82,78,75,71,69,66,64,63,62,61,61,59,59,55,52,50,48,45,43,41,40,34,28,
97,97,97,97,97,93,91,88,84,83,82,80,77,75,70,69,65,64,65,66,65,62,61,58,56,55,52,50,47,45,40,36,29,
97,97,98,99,101,96,93,89,86,84,83,81,81,76,73,69,66,67,68,69,71,67,65,62,60,58,56,54,53,46,41,35,30,
95,95,98,98,98,97,93,90,87,86,85,84,80,76,73,70,67,68,68,68,70,70,68,67,64,62,58,57,52,48,42,36,31,
95,96,98,97,96,95,94,91,89,88,89,84,80,77,74,71,68,68,68,69,71,71,72,70,68,64,60,56,53,48,45,38,32,
94,93,95,95,94,93,93,93,90,89,87,84,80,78,74,72,69,70,69,70,71,71,73,74,72,67,62,59,53,48,44,39,33,
94,93,93,92,93,92,92,92,92,89,86,83,81,77,75,72,70,70,71,71,73,73,74,75,77,70,65,59,55,49,44,39,35,
93,92,92,92,91,92,91,92,90,88,87,86,82,80,76,73,71,72,73,73,72,74,75,76,74,71,65,62,57,53,46,40,35,
92,92,92,91,90,90,90,89,89,88,88,86,84,81,78,75,72,74,76,74,73,74,76,74,72,69,67,63,60,54,49,42,36,
91,92,90,90,89,89,88,87,87,86,87,87,86,84,79,75,73,75,75,75,73,72,73,71,70,69,66,65,63,57,50,44,37,
91,89,89,88,88,87,87,86,87,86,87,87,88,84,81,77,74,74,74,74,75,72,71,69,68,67,67,66,67,59,52,45,39,
89,88,88,87,87,85,86,84,85,85,85,87,86,84,82,80,75,74,74,73,72,72,71,70,66,66,64,63,62,56,50,45,39,
89,88,88,87,86,86,86,85,84,84,85,84,84,84,85,80,76,75,74,72,71,71,72,68,64,63,63,60,59,53,49,44,41,
88,89,87,86,85,83,84,84,83,84,82,82,82,83,81,79,77,76,73,71,69,70,68,66,62,60,59,56,55,52,48,45,42,
89,87,86,85,85,83,83,82,83,81,81,80,80,79,79,78,78,75,73,70,69,66,64,62,61,58,56,54,52,50,48,46,44,
87,86,86,86,84,86,85,83,82,83,85,85,83,83,81,78,77,75,75,71,69,69,66,63,61,62,60,58,53,52,52,48,45,
86,86,87,85,84,86,89,85,83,86,90,88,86,85,85,80,77,77,79,74,70,69,68,65,62,63,64,59,55,55,56,51,46,
85,85,85,86,84,87,86,84,83,87,89,90,89,86,84,80,76,77,76,72,71,69,68,65,63,64,62,60,56,56,54,51,47,
85,84,84,84,85,84,84,84,84,86,88,90,92,88,84,80,76,75,74,73,73,70,68,66,65,62,61,59,59,55,53,50,48,
83,86,86,85,84,87,86,86,84,87,89,89,89,87,85,80,75,74,73,72,72,72,69,66,65,64,64,60,58,57,55,52,49,
83,85,89,86,84,86,88,86,85,87,90,88,86,86,86,80,75,73,73,72,72,71,70,68,67,67,68,63,59,58,58,54,50,
82,82,85,85,84,85,86,85,85,86,86,85,83,83,81,77,74,72,72,74,72,72,70,67,68,66,66,64,59,57,57,54,51,
83,82,83,83,84,84,85,85,86,84,83,81,80,78,77,75,74,73,73,72,72,71,71,70,71,67,65,62,61,58,56,54,53,
81,84,85,86,85,87,86,85,84,82,82,82,80,80,77,75,73,74,74,72,71,71,71,69,69,70,68,67,62,61,58,56,53,
81,84,88,87,86,87,88,85,83,82,82,81,81,79,79,75,73,74,76,73,71,71,72,70,69,70,72,68,65,62,61,57,54,
80,85,86,86,87,88,86,83,81,82,81,82,81,80,77,75,72,72,73,71,70,69,70,71,68,70,70,68,67,64,61,57,55,
80,82,84,86,88,86,84,82,80,80,81,81,82,79,77,74,72,71,71,70,71,69,69,68,68,68,69,69,70,66,63,59,57,
79,82,83,84,85,84,81,81,78,79,80,81,79,76,74,73,71,72,72,69,69,70,68,69,67,69,70,69,68,63,62,58,57,
79,80,83,82,82,80,79,77,77,78,81,78,77,74,73,71,71,72,74,71,69,68,68,67,67,69,72,69,67,64,62,60,59,
78,79,79,78,79,78,76,75,75,77,76,77,74,73,71,69,70,69,71,70,68,67,67,67,66,68,68,68,65,64,62,61,60,
79,77,77,76,76,75,75,74,74,73,73,72,72,71,71,70,70,69,69,68,68,67,67,66,66,65,65,64,64,63,63,62,63,
##########################////////////////////////////////////////
##########################////////////////////////////////////////
############################//////////////////////////////////////
############################//////////////////////////////////////
##############################//////////##////////////////////////
##############################////////////////////////////////////
################################////////######////////////////////
################################////////##########////////////////
################################////##############////////////////
####################################################//////////////
##################################################////////////////
################################################//////////////////
##############################################////////////////////
##############################################////////////////////
##############################################////////////////////
########################################//////////////////////////
######################################////////////////////////////
########################################//////////////////////////
########################################//////////////////////////
##########################################////////////////////////
##########################################////////////////////////
############################################//////////////////////
############################################//////////////////////
############################################//////////////////////
##############################################//##////////////////
##############################################////////////////////
##############################################//////##////////////
########################################//////##//////////////////
######################################//##////////////////////////
######################################////////////////////////////
########################################////////////##////////////
##############################//////##////////////////////////////
##############################////////////////////////////////////

画像

sdsai

関連項目

dtl::shape::DiamondSquareAverageIsland

Clone this wiki locally