Coder Social home page Coder Social logo

amigo's People

Contributors

iorch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

magania

amigo's Issues

engine design

  • How does engine receives the status of the game? (Moves from other player).
  • How does engine let know the best move?
  • How does engine trows away nodes not to be played?

Ladder explorer

  • look for enemy groups with 2 liberties
  • loop over those groups and liberties
  • fill one liberty
  • can enemy kill own stones?
  • place the forced move
  • count liberties
  • check for following cases:
    • more than 2 liberties: escape, ladder fails
    • 2 liberties, fill one liberty, ....
    • 1 liberty, ladder succed

Handicap stones are not considered in groups.

@iorch
I believe that is the problem, in this match 2015-03-01-20.sgf: see the group of stones in P5 at move 82->83

+--+---------------------------------------+`
|   move =  082    turn = B                |
|    A B C D E F G H J K L M N O P Q R S T |
+--+---------------------------------------+
|19| · · · · · · · · · · · · · · · · · · · |
|18| · · · · · · · · · · · · · · · · · · · |
|17| · · ● · · ● · · · · · · · ● · · · · · |
|16| · ⚆ · ● · · · · ● · · · · · · ● · · · |
|15| · · · · · · · · · · · · · · · · · · · |
|14| · · ⚆ · ⚆ · · · · · · · · · · · ⚆ · · |
|13| · · · · · · · · · · · · · · · · · · · |
|12| · · · · · · · · · · · · · · · · · · · |
|11| · · · · · · · · · · · · · ● · · ● · · |
|10| · · · · · · · · · · · · ⚆ ● · ⚆ ● · · |
|09| · · · · · · · ● · · · · ⚆ ● · · · · · |
|08| · · ⚆ ⚆ · · · · · · ⚆ ⚆ · ⚆ ⚆ · ● · · |
|07| · · ● ⚆ · ⚆ · ● · · · ● ● · · · ⚆ ● · |
|06| · · ● ⚆ · · · ● ⚆ · ⚆ ⚆ · ⚆ ⚆ ⚆ · · ● |
|05| · · · ● · ⚆ · ● · · · ● ⚆ ● ● ● ⚆ ● · |
|04| · · · ● · · · ● ⚆ · · ● · ● ⚆ ● ⚆ · · |
|03| · · ● · · ⚆ · ● · · ⚆ · ⚆ ⚆ ⚆ · ⚆ · · |
|02| · · ● ⚆ · · · · · · · · · · ● ⚆ ⚆ · · |
|01| · · · · · · · · · · · · · · · · · · · |
+--+---------------------------------------+
+--+---------------------------------------+
|   move =  083    turn = B                |
|    A B C D E F G H J K L M N O P Q R S T |
+--+---------------------------------------+
|19| · · · · · · · · · · · · · · · · · · · |
|18| · · · · · · · · · · · · · · · · · · · |
|17| · · ● · · ● · · · · · · · ● · · · · · |
|16| · ⚆ · ● · · · · ● · · · · · · ● · · · |
|15| · · · · · · · · · · · · · · · · · · · |
|14| · · ⚆ · ⚆ · · · · · · · · · · · ⚆ · · |
|13| · · · · · · · · · · · · · · · · · · · |
|12| · · · · · · · · · · · · · · · · · · · |
|11| · · · · · · · · · · · · · ● · · ● · · |
|10| · · · · · · · · · · · · ⚆ ● · ⚆ ● · · |
|09| · · · · · · · ● · · · · ⚆ ● · · · · · |
|08| · · ⚆ ⚆ · · · · · · ⚆ ⚆ · ⚆ ⚆ · ● · · |
|07| · · ● ⚆ · ⚆ · ● · · · ● ● · · · ⚆ ● · |
|06| · · ● ⚆ · · · ● ⚆ · ⚆ ⚆ · ⚆ ⚆ ⚆ · · ● |
|05| · · · ● · ⚆ · ● · · · ● ⚆ · · · ⚆ ● · |
|04| · · · ● · · · ● ⚆ · · ● · ● ⚆ ● ⚆ · · |
|03| · · ● · · ⚆ · ● · · ⚆ ⚆ ⚆ ⚆ ⚆ · ⚆ · · |
|02| · · ● ⚆ · · · · · · · · · · ● ⚆ ⚆ · · |
|01| · · · · · · · · · · · · · · · · · · · |
+--+---------------------------------------+

gut design

Should gut know about komi and captured stones?

Definir arquitectura

@magania: Quiero empezar a pasar las funcionalidades que están en sgf2board.py a c++. Voy a empezar creando la clase Group. Pero me surgió una duda con Kifu. ¿Tu idea es que Kifu sea una clase muy sencilla, que sólo guarde la información de la partida? ¿O que, además de guardar esa información, también sea capaz de darte el status del juego dado un número de jugada? La segunda opción es lo que hace mi clase Kifu en sgf2board.py. Si prefieres la primera opción, ¿significa que la clase board_layer tomará un objeto Kifu y regresará alguna característica del tablero en determiando moviemiento?

policy design

  • How does policy knows state of the board?
  • How does policy knows the legal moves?

Feature builder

  • Stone colour, 3. (Player stone / opponent stone / empty)
  • Ones, 1.
  • Turns since, 8. (How many turns since a move was played) (¿in adjacent points?)
  • Liberties, 8. (Number of liberties (empty adjacent points))
  • Capture, 8. (How many opponent stones would be captured) (¿in adjacent points?)
  • Self-atari, 8. (How many of own stones would be captured)
  • Liberties after move, 8. (Number of liberties after this move is played) (¿in adjacent points?)
  • Ladder capture, 1. Whether a move at this point is a successful ladder capture
  • Ladder escape, 1. Whether a move at this point is a successful ladder escape
  • Sensibleness, 1. Whether a move is legal and does not fill its own eyes
  • Zeros, 1.
  • Current player color, 1. Whether current player is black

Compiling error

test.cc

#include "amigo.h"
#include "kifu.h"
#include "policy.h"
#include "value.h"
#include "engine.h"


int main(int argc, char** argv) {
    std::string file_name("in.sgf");
    if (argc == 2)
        file_name = argv[1];

    std::cout << file_name << '\n';
    amigo::kifu k(file_name);
    auto board = k.position_at(83);
    board.draw();

//    amigo::engine e;
//    e.think();

//    for (auto& g : board.get_groups("white")){
//        board.draw_layer(g.first);
//        board.draw_layer(g.second);
//    }

    return 0;
}

makefile

FLAGS=-std=c++11 -g -D__DOCHECK
INCLUDES=-I ./include

test_x: test.cc include/amigo.h include/kifu.h include/policy.h include/engine.h include/value.h
    ${CXX} ${FLAGS} ${INCLUDES} $< -o $@


test: test_x
    echo "done."

errors:

c++ -std=c++11 -g -D__DOCHECK -I ./include test.cc -o test_x
In file included from test.cc:3:
./include/policy.h:27:39: error: implicit instantiation of undefined template 'std::__1::array<amigo::priority_, 362>'
    std::array<priority_, NPOSITIONS> evaluate(const board& brd) {
                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:95:65: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
                                                                ^
In file included from test.cc:3:
./include/policy.h:28:43: error: implicit instantiation of undefined template 'std::__1::array<amigo::priority_, 362>'
        std::array<priority_, NPOSITIONS> result;
                                          ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:95:65: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
                                                                ^
In file included from test.cc:5:
./include/engine.h:22:49: error: implicit instantiation of undefined template 'std::__1::array<amigo::priority_, 362>'
        const std::array<priority_, NPOSITIONS> priorities;
                                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:95:65: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
                                                                ^
In file included from test.cc:5:
./include/engine.h:23:46: error: implicit instantiation of undefined template 'std::__1::array<std::__1::shared_ptr<amigo::engine::node_>, 362>'
        std::array<shared_node_, NPOSITIONS> children;
                                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:95:65: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
                                                                ^
In file included from test.cc:1:
In file included from ./include/amigo.h:4:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4311:18: error: assigning to 'std::__1::__shared_weak_count *' from
      incompatible type 'pointer' (aka 'std::__1::__shared_ptr_emplace<amigo::engine::node_, std::__1::allocator<amigo::engine::node_> > *')
    __r.__cntrl_ = __hold2.release();
                 ^ ~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4672:29: note: in instantiation of function template specialization
      'std::__1::shared_ptr<amigo::engine::node_>::make_shared<const amigo::board &, amigo::gut &, amigo::policy &>' requested here
    return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
                            ^
./include/engine.h:34:21: note: in instantiation of function template specialization 'std::__1::make_shared<amigo::engine::node_, const amigo::board &, amigo::gut &, amigo::policy
      &>' requested here
        return std::make_shared<node_>(b, value_, policy_);
                    ^
5 errors generated.
make: *** [test_x] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.