# Quick start(under investigation)
[modern shogi](https:/ /chaosus.itch.io/modern-shogi) provides quick starter kit to enjoy computer Shogi.

# You need evaluation function, search engine and GUI tool
To start computer Shogi on your computer, you need evaluation function, search engine and GUI tool

This article show you how to install elmo / apery-qhapaq(aperypaq) (used as benchmark of [AlphaZero](http://science.sciencemag.org/content/362/6419/1140)) and NNUE-type functions (current state of the art)

# Install elmo / aperypaq

## Download elmo / aperypaq evaluation functions
You can download evaluation functions here ([elmo](https://drive.google.com/file/d/0B0XpI3oPiCmFalVGclpIZjBmdGs/view), [aperypaq](https://github.com/qhapaq-49/qhapaq-bin/releases/download/eloqhappa/aperypaq.7z))

elmo and aperypaq functions belong to KPPT function which consists of KPP_synthesized.bin, KKP_synthesized.bin and KK_synthesized.bin.

## Install YaneuraOu (search engine)
[YaneuraOu](https://github.com/yaneurao/YaneuraOu) is one of the strongest search
 engines. You can download latest YaneuraOu on github.

### for windows
You can download latest YaneuraOu binary for windows [here](https://github.com/yaneurao/YaneuraOu/releases/download/V4.83/YaneuraOu2018V483all.zip)

If your CPU supports SSE, you can use YaneuraOu2018KPPT_sse42.exe as search engine, and if your CPU supperts AVX, you can use YaneuraOu2018KPPT_avx2.exe.

### for ubuntu (compile by your own)
You can download source code using git.
```
git clone https://github.com/yaneurao/YaneuraOu.git
```

If you want to compile YaneuraOu binary by gcc, you need to modify Makefile

```Makefile
# uncomment g++ compiler and comment clang compiler
COMPILER = g++
# COMPILER = clang++
```

Then you can compile binary by
```
make sse42
```

If your CPU supports AVX, you can compile binary by

```
make avx2
```

Compiler will generate YaneuraOu-by-gcc as search engine.

## Operation check
You need to put both search engine and evaluation function at the same directory. Here is an example

```
shogi
 ┣ YaneuraOu (YaneuraOu-by-gcc or YaneuraOu2018KPPT_xx.exe)
 ┣ elmo (rename the folder)
 │    ┣ KK_synthesized.bin
 │    ┣ KKP_synthesized.bin
 │    ┣ KPP_synthesized.bin
 ┣ aperypaq (rename the folder)
     ┣ KK_synthesized.bin
     ┣ KKP_synthesized.bin
     ┣ KPP_synthesized.bin
```

Then, boot the search engine (double click exe or boot on the shell). If YaneuraOu boots successfully, send the following commands.

```
setoption name EvalDir value elmo
bench
```

If it works without error, installation is finished congratulations !!

### Run YaneuraOu using CUI
YaneuraOu supports [USI protocol](http://hgm.nubati.net/usi.html), please see the link for detail.

# GUI engine to watch
You need GUI engine to visualize Shogi game. Shogidokoro provides you GUI interface to watch and analyse Shogi game.

You can download Shogidokoro [here](http://shogidokoro.starfree.jp/download/Shogidokoro.zip). 

Shogidokoro supports only Windows. If you want to boot Shogidokoro on ubuntu, you need mono.

```
# install mono-devel is recommended.
# Shogidokoro sometimes crashes on ubuntu and booting via mono is thought to be the best stable
sudo apt-get install mono-devel
mono ./Shogidokoro.exe
```
You can see how to use Shogidokoro on [youtube video](https://www.youtube.com/watch?v=B4VoyAcb4l8)

# Install NNUE functions
Current state of the art of evaluation function uses NNUE function which is fast and shallow neural network. 2018 Dec's state of the art's wining rate to elmo is over 90% which is as strong as AlphaZero

## Download orqha / nnuekai evaluation functions
orqha and nnuekai is one of the strongest NNUE functions whose rating is close to AlphaZero. You can download evaluation function here [orqha](https://www.qhapaq.org/static/media/bin/orqha.7z) [nnuekai7](https://onedrive.live.com/?authkey=%21ADXFPaoXVeV0uFE&id=67BEC1094A080033%2135642&cid=67BEC1094A080033)

## Install YaneuraOu (search engine)
[YaneuraOu](https://github.com/yaneurao/YaneuraOu) is one of the strongest search
 engines. You can download latest YaneuraOu on github.

### for windows
You can download latest YaneuraOu binary for windows [here](https://github.com/yaneurao/YaneuraOu/releases/download/V4.83/YaneuraOu2018V483all.zip)

If your CPU supports SSE, you can use YaneuraOu2018NNUE_sse42.exe as search engine, and if your CPU supperts AVX, you can use YaneuraOu2018NNUE_avx2.exe.

### for ubuntu (compile by your own)
You can download source code using git.
```
git clone https://github.com/yaneurao/YaneuraOu.git
```

If you want to use YaneuraOu for NNUE function, you need to modify Makefile

```Makefile
# comment
#YANEURAOU_EDITION = YANEURAOU_2018_OTAFUKU_ENGINE
#YANEURAOU_EDITION = HELP_MATE_ENGINE
#YANEURAOU_EDITION = MATE_ENGINE
#YANEURAOU_EDITION = YANEURAOU_2018_GOKU_ENGINE
# uncomment
YANEURAOU_EDITION = YANEURAOU_2018_TNK_ENGINE

// .....

# uncomment g++ compiler and comment clang compiler optional
COMPILER = g++
# COMPILER = clang++
```

Then you can compile binary by
```
make sse42
```

If your CPU supports AVX, you can compile binary by

```
make avx2
```

Compiler will generate YaneuraOu-by-gcc as search engine.

## Operation check
You need to put both search engine and evaluation function at the same directory. Here is an example

```
shogi
 ┣ YaneuraOu (YaneuraOu-by-gcc or YaneuraOu2018NNUE_xx.exe)
 ┣ orqha (rename the folder)
 │    ┣ nn.bin
 ┣ nnuekai7 (rename the folder)
     ┣ nn.bin
```

Then, boot the search engine (double click exe or boot on the shell). If YaneuraOu boots successfully, send the following commands.

```
setoption name EvalDir value orqha
bench
```

If it works without error, installation is finished congratulations !!

# GUI engine to watch (same to KPPT)
You need GUI engine to visualize Shogi game. Shogidokoro provides you GUI interface to watch and analyse Shogi game.

You can download Shogidokoro [here](http://shogidokoro.starfree.jp/download/Shogidokoro.zip). 

Shogidokoro supports only Windows. If you want to boot Shogidokoro on ubuntu, you need mono.

```
# install mono-devel is recommended.
# Shogidokoro sometimes crashes on ubuntu and booting via mono is thought to be the best stable
sudo apt-get install mono-devel
mono ./Shogidokoro.exe
```
You can see how to use Shogidokoro on [youtube video](https://www.youtube.com/watch?v=B4VoyAcb4l8)

# Link
[Installation guide by uuunuuun](http://www.uuunuuun.com/single-post/2017/12/09/How-to-install-Yaneuraou-engine-with-third-party-evaluation-fileopening-book)