Skip to content

Commit

Permalink
🎨 Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Clang Robot committed Mar 16, 2022
1 parent 46c18d5 commit 24d07c1
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <array>
#include <functional>
#include <iostream>
#include <random>
#include <array>

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

std::size_t move_count{0};
std::size_t move_count{ 0 };

std::string &get_string(std::size_t x, std::size_t y) {
return strings.at(x).at(y);
}
std::string &get_string(std::size_t x, std::size_t y) { return strings.at(x).at(y); }


void set(std::size_t x, std::size_t y, bool new_value)
{
get(x,y) = new_value;
get(x, y) = new_value;

if (new_value) {
get_string(x,y) = " ON";
get_string(x, y) = " ON";
} else {
get_string(x,y) = "OFF";
get_string(x, y) = "OFF";
}
}

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

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

Expand Down

0 comments on commit 24d07c1

Please sign in to comment.