Skip to content

Commit 24d07c1

Browse files
author
Clang Robot
committed
🎨 Committing clang-format changes
1 parent 46c18d5 commit 24d07c1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/main.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
#include <array>
12
#include <functional>
23
#include <iostream>
34
#include <random>
4-
#include <array>
55

66
#include <docopt/docopt.h>
77
#include <ftxui/component/captured_mouse.hpp>// for ftxui
@@ -35,21 +35,19 @@ template<std::size_t Width, std::size_t Height> struct GameBoard
3535
std::array<std::array<std::string, height>, width> strings;
3636
std::array<std::array<bool, height>, width> values{};
3737

38-
std::size_t move_count{0};
38+
std::size_t move_count{ 0 };
3939

40-
std::string &get_string(std::size_t x, std::size_t y) {
41-
return strings.at(x).at(y);
42-
}
40+
std::string &get_string(std::size_t x, std::size_t y) { return strings.at(x).at(y); }
4341

4442

4543
void set(std::size_t x, std::size_t y, bool new_value)
4644
{
47-
get(x,y) = new_value;
45+
get(x, y) = new_value;
4846

4947
if (new_value) {
50-
get_string(x,y) = " ON";
48+
get_string(x, y) = " ON";
5149
} else {
52-
get_string(x,y) = "OFF";
50+
get_string(x, y) = "OFF";
5351
}
5452
}
5553

@@ -126,7 +124,7 @@ int main(int argc, const char **argv)
126124
std::vector<ftxui::Component> buttons;
127125
for (std::size_t x = 0; x < gb.width; ++x) {
128126
for (std::size_t y = 0; y < gb.height; ++y) {
129-
buttons.push_back(ftxui::Button(&gb.get_string(x,y), [=, &gb] {
127+
buttons.push_back(ftxui::Button(&gb.get_string(x, y), [=, &gb] {
130128
if (!gb.solved()) { gb.press(x, y); }
131129
update_quit_text(gb);
132130
}));
@@ -162,7 +160,7 @@ int main(int argc, const char **argv)
162160
static constexpr int randomization_iterations = 100;
163161
static constexpr int random_seed = 42;
164162

165-
std::mt19937 gen32{random_seed}; // NOLINT
163+
std::mt19937 gen32{ random_seed };// NOLINT
166164
std::uniform_int_distribution<std::size_t> x(static_cast<std::size_t>(0), gb.width - 1);
167165
std::uniform_int_distribution<std::size_t> y(static_cast<std::size_t>(0), gb.height - 1);
168166

0 commit comments

Comments
 (0)