-
-
Notifications
You must be signed in to change notification settings - Fork 87
中級サンプル
Kasugaccho edited this page Apr 27, 2019
·
2 revisions
#include <DTL.hpp>
#include <array>
#include <bitset>
#include <cstddef>
int main() {
//X方向の大きさ
constexpr std::size_t width{ 33 };
//Y方向の大きさ
constexpr std::size_t height{ 17 };
//ダンジョン行列 (0で初期化)
std::array<std::bitset<width>, height> matrix{ {} };
//迷路を生成 (値1の通路を作成する)
dtl::MazeDig<bool>(1).draw(matrix, width, height);
//数値出力 (区切りは「,」)
dtl::OutputNumber<bool>(",").draw(matrix, width, height);
//文字出力 (値0の場合は「##」、値1の場合は「 」が出力される)
dtl::OutputString<bool>("##", " ").draw(matrix, width, height);
}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,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,
0,0,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,
0,1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,0,
0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,
0,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,
0,1,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,
0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,
0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,
0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,
0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,
0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,0,
0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,
0,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,0,
0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,
0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,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,0,0,0,0,0,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)