项目作者: Roytangrb

项目描述 :
Hexgame C++ implementation with Bazel build + GTest
高级语言: C++
项目地址: git://github.com/Roytangrb/hexgame.git
创建时间: 2020-12-27T08:00:36Z
项目社区:https://github.com/Roytangrb/hexgame

开源协议:

下载


Hexgame

Setup

Bazel

  • Bazel version: bazel 3.7.2-homebrew
  • Bazel setup
  • Bazel C++

GTest

  • GTest version: @tag v1.10.x
  • Include GTest as external lib in WORKSPACE file
  • Used as deps in //test package

Commands

  • Build: bazel build //main:hex
  • Run: bazel build //main:hex or run ./bazel-bin/main/hex
  • Build GTest lib: bazel build //test:hello_test
  • Run a test: bazel run //test:hello_test

Program does

  1. Draw the board using ASCII symbols and a given size, such as 7 by 7 or 11 by 11
  2. Input a move and determine if a move is legal.
  3. Computer opponent move based on Monte Carlo simulation
  4. Determine who won.

Deps graph

  • Install dot command line tool with GraphViz: brew install graphviz
  • dot version: dot -V - dot - graphviz version 2.44.1 (20200629.0846)
  • Deps Graph: bazel query --notool_deps --noimplicit_deps "deps(//main:hex)" --output graph
  • Export graph: bazel query --notool_deps --noimplicit_deps "deps(//main:hex)" --output graph | dot -Tpng > assets/images/deps.png

deps-graph.png

Reference