-
-
Notifications
You must be signed in to change notification settings - Fork 81
dtl::shape::Shogi (形状クラス)
Kasugaccho edited this page Aug 17, 2019
·
3 revisions
namespace dtl::shape {
template <typename T>
class Shogi;
}
※ T
は1bit以上の型
Shogi
とは "Matrixの描画範囲に将棋の駒を初期位置に設置する" 機能を持つクラスである。
描画範囲の全てを必ず塗りつぶすとは限らない (Matrixの初期化が必要) 。
機能名 | 対応 |
---|---|
非長方形Matrix | 可能✅ |
#include <DTL.hpp>
#include <cstdint>
#include <array>
int main() {
using shape_t = std::uint_fast8_t;
std::array<std::array<shape_t, 9>, 9> matrix{ {} };
dtl::shape::Shogi<shape_t>(
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28).draw(matrix);
dtl::console::OutputString<shape_t>(
" * ", "fuh< ", "fuh> ", "tok< ", "tok> ", "kyo< ", "kyo> ", "nky< ", "nky> ", "kei< ", "kei> ", "nke< ", "nke> ", "gin< ", "gin> ",
"ngi< ", "ngi> ", "his< ", "his> ", "ryo< ", "ryo> ", "kak< ", "kak> ", "rym< ", "rym> ", "kin< ", "kin> ", "osh< ", "gyo> ").draw(matrix);
return 0;
}
kyo< kei< gin< kin< osh< kin< gin< kei< kyo<
* his< * * * * * kak< *
fuh< fuh< fuh< fuh< fuh< fuh< fuh< fuh< fuh<
* * * * * * * * *
* * * * * * * * *
* * * * * * * * *
fuh> fuh> fuh> fuh> fuh> fuh> fuh> fuh> fuh>
* kak> * * * * * his> *
kyo> kei> gin> kin> gyo> kin> gin> kei> kyo>
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)