File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,10 +64,11 @@ jobs:
6464 - uses : dart-lang/setup-dart@v1
6565
6666 - name : build libedax
67+ shell : bash
6768 env :
6869 dst : ' .'
6970 libedax_build_command : ${{ matrix.libedax_build_command }}
70- run : sh scripts/build_libedax.sh
71+ run : ./ scripts/build_libedax.sh
7172
7273 - name : output build info
7374 shell : bash
Original file line number Diff line number Diff line change @@ -26,10 +26,11 @@ jobs:
2626 - uses : actions/checkout@v2
2727
2828 - name : build libedax
29+ shell : bash
2930 env :
3031 dst : ${{ env.OUTPUT_DIR }}
3132 libedax_build_command : ${{ matrix.libedax_build_command }}
32- run : sh scripts/build_libedax.sh
33+ run : ./ scripts/build_libedax.sh
3334
3435 - name : output build info
3536 shell : bash
Original file line number Diff line number Diff line change 1+ # 2.7.0
2+
3+ - add const ` ColorChar ` .
4+
15# 2.6.0
26
37- upgrade dependencies
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ packages:
8484 path: ".."
8585 relative: true
8686 source: path
87- version: "2.6 .0"
87+ version: "2.7 .0"
8888 meta:
8989 dependency: transitive
9090 description:
Original file line number Diff line number Diff line change 11name : libedax4dart_example
2- version : 2.6 .0-example
2+ version : 2.7 .0-example
33publish_to : none
44
55environment :
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ class Board {
5858 ///
5959 /// e.g. `-------------------*-------**O----**O*-----O--------------------W` .
6060 String stringApplicableToSetboard (final int currentColor) {
61- final pStone = currentColor == TurnColor .black ? '*' : 'O' ;
62- final oStone = currentColor == TurnColor .black ? 'O' : '*' ;
61+ final pStone = currentColor == TurnColor .black ? ColorChar .black : ColorChar .white ;
62+ final oStone = currentColor == TurnColor .black ? ColorChar .white : ColorChar .black ;
6363
6464 final buffer = StringBuffer ();
6565 for (var k = 0 ; k < 8 ; k++ ) {
@@ -93,8 +93,8 @@ class Board {
9393 /// 8 - - - - - - - - 8 <br>
9494 /// A B C D E F G H
9595 String prettyString (final int currentColor) {
96- final pStone = currentColor == TurnColor .black ? '*' : 'O' ;
97- final oStone = currentColor == TurnColor .black ? 'O' : '*' ;
96+ final pStone = currentColor == TurnColor .black ? ColorChar .black : ColorChar .white ;
97+ final oStone = currentColor == TurnColor .black ? ColorChar .white : ColorChar .black ;
9898
9999 final buffer = StringBuffer ()..writeln (' A B C D E F G H' );
100100 for (var k = 0 ; k < 8 ; k++ ) {
Original file line number Diff line number Diff line change @@ -6,6 +6,15 @@ class TurnColor {
66 static const white = 1 ;
77}
88
9+ /// See: https://github.com/abulmo/edax-reversi/blob/1ae7c9fe5322ac01975f1b3196e788b0d25c1e10/src/board.c#L144-L200
10+ class ColorChar {
11+ /// BLACK char. You can use this for `LibEdax.edaxSetboard` .
12+ static const black = '*' ;
13+
14+ /// WHITE char. You can use this for `LibEdax.edaxSetboard` .
15+ static const white = 'O' ;
16+ }
17+
918class MoveMark {
1019 /// PASS string of BLACK.
1120 ///
Original file line number Diff line number Diff line change 11# See: https://dart.dev/tools/pub/publishing
22
33name : libedax4dart
4- version : 2.6 .0
4+ version : 2.7 .0
55description : Dart wrapper for libedax. With using libedax4dart, you can execute functions equivalent to edax.
66homepage : https://github.com/sensuikan1973/libedax4dart
77documentation : https://sensuikan1973.github.io/libedax4dart
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euxo pipefail
3+
14# NOTE: require some environment variables.
25# libedax_build_command (e.g. make libbuild ARCH=x64-modern COMP=gcc OS=osx)
36# dst: (e.g. build)
47#
58# example:
69# libedax_build_command="make libbuild ARCH=x64-modern COMP=gcc OS=osx" dst="." ./scripts/build_libedax.sh
710
11+ rm -rf edax-reversi
812git clone https://github.com/sensuikan1973/edax-reversi
913cd edax-reversi
1014git remote update --prune
11-
12- git checkout .
13-
1415git switch libedax_sensuikan1973
15- git pull
1616git checkout $( cat ../.libedax-version)
1717
1818mkdir -p data
Original file line number Diff line number Diff line change @@ -83,14 +83,14 @@ void main() {
8383 });
8484
8585 test ('setBoard' , () {
86- const boardString = '-W ----W --------------------WB ------WBB -----W --------------------B' ;
86+ const boardString = '-O ----O --------------------O* ------O** -----O --------------------B' ;
8787 final edax = LibEdax ()..libedaxInitialize ();
8888 sleep (const Duration (seconds: 1 ));
8989 edax
9090 ..edaxInit ()
9191 ..edaxSetboard (boardString);
92- expect (edax.edaxGetDisc (TurnColor .white), 'W' .allMatches (boardString).length);
93- expect (edax.edaxGetDisc (TurnColor .black), 'B' . allMatches (boardString).length - 1 );
92+ expect (edax.edaxGetDisc (TurnColor .white), ColorChar .white .allMatches (boardString).length);
93+ expect (edax.edaxGetDisc (TurnColor .black), ColorChar .black. allMatches (boardString).length);
9494 expect (edax.edaxGetCurrentPlayer (), TurnColor .black);
9595 edax.libedaxTerminate ();
9696 });
You can’t perform that action at this time.
0 commit comments