-
-
Notifications
You must be signed in to change notification settings - Fork 81
ノイズ
Kasugaccho edited this page Mar 8, 2019
·
8 revisions
void dtl::utility::stl::noiseBool<dungeon_t>(matrix, noise_probability);
例
#include <array>
#include "DTL.hpp"
int main() {
using dungeon_t = bool;
std::array<std::array<dungeon_t, 10>, 8> matrix{ {} };
dtl::utility::stl::noiseBool(matrix, 0.6);
dtl::console::output::stl::stringBool(matrix, "##", "//");
return 0;
}
出力例
////####////##////##
//####//##########//
//##////####////////
////##//##////##////
########//######//##
//##//######////####
######//##//////####
####////####////####
void dtl::utility::stl::noiseShoreBool(matrix, noise_probability);
例
#include <array>
#include "DTL.hpp"
int main() {
using dungeon_t = bool;
std::array<std::array<dungeon_t, 64>, 64> matrix{ {} };
dtl::random::mersenne_twister_32bit.seed(2);
dtl::generator::terrain::stl::SimpleVoronoiIsland<dungeon_t> generation(matrix);
dtl::utility::stl::noiseShoreBool(matrix, 0.4);
dtl::console::output::stl::stringBool(matrix, "##", "//");
return 0;
}
出力例(前者:ノイズあり、後者:ノイズなし)
void dtl::utility::stl::rnoiseShoreBool(matrix, noise_probability);
例
#include <array>
#include "DTL.hpp"
int main() {
using dungeon_t = bool;
std::array<std::array<dungeon_t, 64>, 64> matrix{ {} };
dtl::random::mersenne_twister_32bit.seed(2);
dtl::generator::terrain::stl::SimpleVoronoiIsland<dungeon_t> generation(matrix);
dtl::utility::stl::rnoiseShoreBool(matrix, 0.4);
dtl::console::output::stl::stringBool(matrix, "##", "//");
return 0;
}
出力例(前者:ノイズあり、後者:ノイズなし)
Copyright (c) 2018-2021 As Project.
Distributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)