The Game of Life is not your typical computer game. It is a 'cellular automaton', and was invented by Cambridge mathematician John Conway.
- Windows
-
- macOS
-
- Gnome
-
#include "sudoku.hpp"
#include <xtd/xtd>
auto print_grid(const sudoku::sudoku::grid_type& grid) -> void {
for (auto y = 0_z; y < grid.get_length(0); ++y) {
for (auto x = 0_z; x < grid.get_length(1); ++x)
print("{} ", grid(y, x));
println();
}
}
auto main() -> int {
auto sudoku1 = sudoku::sudoku::make_puzzle(sudoku::sudoku::difficulty::easy);
file::write_all_text("data.txt", string::join("\n", sudoku1.to_array().chunk(sudoku1.grid().get_length(0)).select<string>([](auto c){return string::join(" ", c);})));
println(string('_', 25));
println("{,25}", "Puzzle");
print_grid(sudoku1.grid());
println();
sudoku1.solve();
println(string('_', 25));
println("{,25}", "Solved");
print_grid(sudoku1.grid());
println();
application::run(form::create("Sudoku"));
}