<commit_before>/*
 * Copyright (C) 2014-2015 <NAME>
 *
 * See the LICENSE file for terms of use.
 */

#include <iostream>
#include <boost/bind.hpp>

#include "luabind-format-signature.hpp"
#include <lua.hpp>
#include <luabind/luabind.hpp>
#include <luabind/object.hpp>

#include "BotView.hpp"

using namespace luabind;

BotView::BotView() {
    L_ = luaL_newstate();
    luaL_openlibs(L_);
    int status = luaL_dofile(L_, "bin_game_bot.lua");
    if (status) {
        std::cerr << lua_tostring(L_, -1) << "\n";
    }
    luabind::open(L_);
    module(L_) [
        class_<const GameDesk>("GameDesk")
        .def("getDeskNumber", &GameDesk::getDeskNumber)
        ,
        class_<Point>("Point")
        .def(constructor<>())
        .def_readwrite("col", &Point::col)
        .def_readwrite("row", &Point::row)
        ,
        class_<Points>("Points")
        .def(constructor<>())
        .def_readwrite("p1", &Points::p1)
        .def_readwrite("p2", &Points::p2)
    ];
}

BotView::~BotView() {
    lua_close(L_);
}

int BotView::getDeskSize_impl() const {
    std::cout << "Please enter size of the game board."
              << std::endl;
    std::cout << "Your board will have x * x square."
              << std::endl;
    std::cout << "(Where x is input size)" << std::endl;
    std::cout << "Minimum size is " << MIN_WIDTH << " and "
                 "maximum is " << MAX_WIDTH << std::endl;
    std::cout << "But try to choose size which "
                 "corresponds to the size of your screen."
              << std::endl;
    prompt();
    int size = object_cast<int>(globals(L_)["getDeskSize"]());
    std::cout << size << std::endl;
    return size;
}

int BotView::getWinNumber_impl() const {
    std::cout << "What score you want to finish the "
                 "game?" << std::endl;
    std::cout << "Minimum is " << MIN_SCORE << " and "<commit_msg>BotView: use "square * 2" instead of MIN_SCORE<commit_after>/*
 * Copyright (C) 2014-2015 <NAME>
 *
 * See the LICENSE file for terms of use.
 */

#include <iostream>
#include <boost/bind.hpp>

#include "luabind-format-signature.hpp"
#include <lua.hpp>
#include <luabind/luabind.hpp>
#include <luabind/object.hpp>

#include "BotView.hpp"

using namespace luabind;

BotView::BotView() {
    L_ = luaL_newstate();
    luaL_openlibs(L_);
    int status = luaL_dofile(L_, "bin_game_bot.lua");
    if (status) {
        std::cerr << lua_tostring(L_, -1) << "\n";
    }
    luabind::open(L_);
    module(L_) [
        class_<const GameDesk>("GameDesk")
        .def("getDeskNumber", &GameDesk::getDeskNumber)
        ,
        class_<Point>("Point")
        .def(constructor<>())
        .def_readwrite("col", &Point::col)
        .def_readwrite("row", &Point::row)
        ,
        class_<Points>("Points")
        .def(constructor<>())
        .def_readwrite("p1", &Points::p1)
        .def_readwrite("p2", &Points::p2)
    ];
}

BotView::~BotView() {
    lua_close(L_);
}

int BotView::getDeskSize_impl() const {
    std::cout << "Please enter size of the game board."
              << std::endl;
    std::cout << "Your board will have x * x square."
              << std::endl;
    std::cout << "(Where x is input size)" << std::endl;
    std::cout << "Minimum size is " << MIN_WIDTH << " and "
                 "maximum is " << MAX_WIDTH << std::endl;
    std::cout << "But try to choose size which "
                 "corresponds to the size of your screen."
              << std::endl;
    prompt();
    int size = object_cast<int>(globals(L_)["getDeskSize"]());
    std::cout << size << std::endl;
    return size;
}

int BotView::getWinNumber_impl() const {
    int square = getBoardsSquare();
    std::cout << "What score you want to finish the "
                 "game?" << std::endl;
    std::cout << "Minimum is " << square * 2 << " and "
{'fraction_non_alphanumeric': 0.17189952904238617, 'fraction_numerical': 0.007326007326007326, 'mean_word_length': 2.668905950095969, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7515697', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1305, 'n_words': 298}