#include"ftxui/dom/elements.hpp" // for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element
#include<ftxui/dom/elements.hpp> // for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element
#include"ftxui/dom/node.hpp" // for Render
#include<ftxui/dom/node.hpp> // for Render
#include"ftxui/screen/box.hpp" // for ftxui
#include<ftxui/screen/box.hpp> // for ftxui
#include<ftxui/component/component.hpp>
usingnamespacestd::chrono_literals;
usingnamespacestd::chrono_literals;
std::array<std::string,6>tiles={
"##########",
"# #",
"# #",
"# |",
"# #",
"##########",
};
intmain(){
intmain(){
usingnamespaceftxui;
usingnamespaceftxui;
std::stringp=
R"(In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule) describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For example, if cancer is related to age, then, using Bayes' theorem, a person's age can be used to more accurately assess the probability that they have cancer, compared to the assessment of the probability of cancer made without knowledge of the person's age. One of the many applications of Bayes' theorem is Bayesian inference, a particular approach to statistical inference. When applied, the probabilities involved in Bayes' theorem may have different probability interpretations. With the Bayesian probability interpretation the theorem expresses how a subjective degree of belief should rationally change to account for availability of related evidence. Bayesian inference is fundamental to Bayesian statistics.)";
std::stringreset_position;
std::stringreset_position;
autoc=Canvas(100,100);
// A triangle following the mouse, using braille characters.
automap=Renderer([&]{
for(size_ti=0;i<tiles.size();++i){
c.DrawText(50,50+i*4,tiles[i]);
}
for(size_ti=0;i<tiles[0].size()-2;i++){
for(size_tj=0;j<tiles.size()-2;j++){
c.DrawText(52+i*2,54+j*4,".",Color::Yellow);
}
}
c.DrawText(50+3*4,50+3*4,"@",Color::Blue);
returncanvas(c);
});
while(true){
while(true){
autodocument=vbox({
autodocument=hbox({
hflow(paragraph(p)),
hflow(
separator(),
vbox(
hflow(paragraph(p)),
gauge(0.5)|border,
separator(),
text("STATUS")|border
hbox({
)|xflex_grow
hflow(paragraph(p)),
),
separator(),
separator(),
hflow(paragraph(p)),
hflow(map->Render()),
}),
})|border;
})|
border;
document=vbox(filler(),document);
// auto screen = Screen::Create(Dimension::Fit(document));