From 0033f6541768a510489406157234be0256878834 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Fri, 20 Nov 2015 07:33:48 +0100 Subject: [PATCH 01/11] Script to play a game against the bot --- bin/play | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/play diff --git a/bin/play b/bin/play new file mode 100755 index 00000000..1b1fb054 --- /dev/null +++ b/bin/play @@ -0,0 +1,11 @@ +#!/bin/bash + +set -ex + +cargo build --release + +IOMRASCALAI="cargo run --release -q" +SIZE=9 +TIME="5m" + +gogui -computer-black -program "$IOMRASCALAI" -size $SIZE From f607bb77f196c1ae54601c6a78a8c7b071fdd1ff Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Fri, 20 Nov 2015 16:30:13 +0100 Subject: [PATCH 02/11] Don't make main public It's not necessary and just makes it appear in the documentation, which is not useful. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e3c026ae..351c2df4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,7 +69,7 @@ mod sgf; mod timer; mod version; -pub fn main() { +fn main() { let mut opts = Options::new(); opts.optflag("d", "dump", "Dump default config to stdout"); opts.optflag("h", "help", "Print this help menu"); From 6bc41b8c2b19bc2f4ea9f7440ed379827eba8d57 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Fri, 20 Nov 2015 16:48:05 +0100 Subject: [PATCH 03/11] Explain the prerequisites and some of the scripts in bin --- README.md | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 59d8983e..49668a56 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,22 @@ Iomrascálaí =========== -Iomrascálaí -(Gaelic for wrestler, [see here for the pronunciation](https://raw.githubusercontent.com/ujh/iomrascalai/master/pronunciation.mp4)) -is an AI for the game of Go/Weiqi/Baduk written in Rust. Please note -that we're using the Rust nightly build and not stable! +Iomrascálaí (Gaelic for wrestler, [see here for the pronunciation](https://raw.githubusercontent.com/ujh/iomrascalai/master/pronunciation.mp4)) is an AI for the game of Go/Weiqi/Baduk written in [Rust](https://www.rust-lang.org). + +Installation +------------ + +Iomrascálaí requires the latest unstable (also called nightly) Rust compiler as well as the latest Cargo. Both are generally installed when you download the installers from the [Rust homepage](https://www.rust-lang.org). You will also need a graphical interface for playing games against the AI. We suggest downloading GoGui (**LINK**). + +Playing games +------------- + +Once you've installed the nightly Rust compiler, Cargo, and [GoGui](http://gogui.sourceforge.net/) you can use the following shell scripts to compile the program and play games: + +* `bin/play` will compile the program and start a game on a 9x9 board with a time limit of 5 minutes (sudden death) in [GoGui](http://gogui.sourceforge.net/). By default it will assign black to Iomrascálaí. The defaults can be changed easily by editing some constants in the script. +* `bin/play-gnugo` will compile the program and start a game on 9x9 with a time limit of 5 minutes (sudden death) against GnuGo. It will assign black to [GnuGo](https://www.gnu.org/software/gnugo/) and the game can be observed in [GoGui](http://gogui.sourceforge.net/). Again, the defaults (board size, time limits, etc.) can be changed by editing the script. +* `bin/play-self` will compile the program and start a game on 9x9 with a time limit of 5 minutes (sudden death) between two copies of Iomrascálaí. Just like with the other scripts the game can be observed in [GoGui](http://gogui.sourceforge.net/) and the parameters can be adjusted by editing the script. + Development =========== @@ -18,27 +30,6 @@ planned features and bugs and [join the mailing list](https://groups.google.com/forum/#!forum/iomrascalai) and [the chat](https://gitter.im/ujh/iomrascalai) for discussion. -Testing -======= - -To play 10 games against GnuGo, install GoGui and run the -following command in the top level folder: - -``` sh -BLACK="gnugo --mode gtp --chinese-rules --positional-superko --capture-all-dead --score aftermath --play-out-aftermath" -WHITE="./target/release/iomrascalai" -gogui-twogtp -auto -black "$BLACK" -white "$WHITE" -size 9 -alternate -time 5m -games 100 -sgffile gnugo-test -``` - -To run a game against GnuGo and view it in GoGui in real time use the following command (add `-auto` if a new game should automatically be started when a game is finished): - -``` sh -BLACK="gnugo --mode gtp --chinese-rules --positional-superko --capture-all-dead --score aftermath --play-out-aftermath" -WHITE="./target/release/iomrascalai" -TWOGTP="gogui-twogtp -black \"$BLACK\" -white \"$WHITE\" -verbose -size 9" -gogui -computer-both -program "$TWOGTP" -size 9 -``` - Resources ========= From 37dc771e8d5d8735b742d1512ee8d2a1f5d4a13d Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Fri, 20 Nov 2015 16:57:29 +0100 Subject: [PATCH 04/11] Some information about the possible configuration variables --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 49668a56..3013d2a1 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ Once you've installed the nightly Rust compiler, Cargo, and [GoGui](http://gogui * `bin/play-gnugo` will compile the program and start a game on 9x9 with a time limit of 5 minutes (sudden death) against GnuGo. It will assign black to [GnuGo](https://www.gnu.org/software/gnugo/) and the game can be observed in [GoGui](http://gogui.sourceforge.net/). Again, the defaults (board size, time limits, etc.) can be changed by editing the script. * `bin/play-self` will compile the program and start a game on 9x9 with a time limit of 5 minutes (sudden death) between two copies of Iomrascálaí. Just like with the other scripts the game can be observed in [GoGui](http://gogui.sourceforge.net/) and the parameters can be adjusted by editing the script. +Program parameters +------------------ + +Many parameters of Iomrascálaí can be changed and those changes directly affect the program strength. + +You set the parameters by supplying a TOML (**LINK**) formatted configuration file when starting the program with either the `-c` or `--config` command line flag. A great way to get started is to capture the output of `-d` (or `--dump`) into a file and edit the variables. This is the default configuration and lists all possible variables with their default values. See the [api documentation](http://bettong.net/iomrascalai/api/iomrascalai) for details on what these variables do. Just use the search on top and enter the name of the configuration variable. It should take you to the page that lists the struct that defines it (e.g. `PriorsConfig` for a variable in the `[priors]` block in the config file). Development =========== From 170f7132ff3dc395ac1269d15147ffd944b0a3b5 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Mon, 30 Nov 2015 09:39:48 +0100 Subject: [PATCH 05/11] Change the run scripts to allow passing in the board size --- bin/play | 24 +++++++++++++++++++++--- bin/play-gnugo | 26 +++++++++++++++++++++++--- bin/play-self | 24 +++++++++++++++++++++--- 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/bin/play b/bin/play index 1b1fb054..93044c6f 100755 --- a/bin/play +++ b/bin/play @@ -1,11 +1,29 @@ #!/bin/bash -set -ex +set -e + +if [ -z "$1" ]; then + SIZE="9" +else + SIZE=$1 +fi + +if [ $SIZE == "9" ]; then + TIME="5m" +elif [ $SIZE == "13" ]; then + TIME="10m" +elif [ $SIZE == "19" ]; then + TIME="20m" +else + echo "Size '$SIZE' isn't supported!" + exit 1 +fi + cargo build --release IOMRASCALAI="cargo run --release -q" -SIZE=9 -TIME="5m" + +set -x gogui -computer-black -program "$IOMRASCALAI" -size $SIZE diff --git a/bin/play-gnugo b/bin/play-gnugo index 0cd487c8..e42d5e37 100755 --- a/bin/play-gnugo +++ b/bin/play-gnugo @@ -1,13 +1,33 @@ #!/bin/bash -set -ex +set -e + +if [ -z "$1" ]; then + SIZE="9" +else + SIZE=$1 +fi + +if [ $SIZE == "9" ]; then + TIME="5m" +elif [ $SIZE == "13" ]; then + TIME="10m" +elif [ $SIZE == "19" ]; then + TIME="20m" +else + echo "Size '$SIZE' isn't supported!" + exit 1 +fi cargo build --release GNUGO="gnugo --mode gtp --level 0 --chinese-rules --positional-superko --capture-all-dead --score aftermath --play-out-aftermath" IOMRASCALAI="cargo run --release" -SIZE=9 -TIME="5m" + TWOGTP="gogui-twogtp -black \"$GNUGO\" -white \"$IOMRASCALAI\" -verbose -size $SIZE -time $TIME" + + +set -x + gogui -computer-both -program "$TWOGTP" -size $SIZE diff --git a/bin/play-self b/bin/play-self index 03558e68..0ae3b64b 100755 --- a/bin/play-self +++ b/bin/play-self @@ -1,12 +1,30 @@ #!/bin/bash -set -ex +set -e + +if [ -z "$1" ]; then + SIZE="9" +else + SIZE=$1 +fi + +if [ $SIZE == "9" ]; then + TIME="5m" +elif [ $SIZE == "13" ]; then + TIME="10m" +elif [ $SIZE == "19" ]; then + TIME="20m" +else + echo "Size '$SIZE' isn't supported!" + exit 1 +fi cargo build --release IOMRASCALAI="cargo run --release" -SIZE=9 -TIME="5m" TWOGTP="gogui-twogtp -black \"$IOMRASCALAI\" -white \"$IOMRASCALAI\" -verbose -size $SIZE -time $TIME" + +set -x + gogui -computer-both -program "$TWOGTP" -size $SIZE From cadb1c36e1b9949de48879d236b0c6286f41b1aa Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Mon, 30 Nov 2015 09:40:07 +0100 Subject: [PATCH 06/11] 500 games for the benchmark --- bin/benchmark | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/benchmark b/bin/benchmark index de2ec466..9dff2fe0 100755 --- a/bin/benchmark +++ b/bin/benchmark @@ -2,8 +2,7 @@ set -e -THREADS=8 -GAMES=300 +GAMES=500 if [ $1 == "9" ]; then TIME="5m" From 36d51b7fbe2b3be365b01626dc1a445c2c10a00e Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Mon, 30 Nov 2015 09:46:34 +0100 Subject: [PATCH 07/11] Changed README to reflect the changes to the run scripts --- README.md | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3013d2a1..97ddd7a7 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,16 @@ Iomrascálaí (Gaelic for wrestler, [see here for the pronunciation](https://raw Installation ------------ -Iomrascálaí requires the latest unstable (also called nightly) Rust compiler as well as the latest Cargo. Both are generally installed when you download the installers from the [Rust homepage](https://www.rust-lang.org). You will also need a graphical interface for playing games against the AI. We suggest downloading GoGui (**LINK**). +Iomrascálaí requires the latest unstable (also called nightly) Rust compiler as well as the latest Cargo. Both are generally installed when you download the installers from the [Rust homepage](https://www.rust-lang.org). You will also need a graphical interface for playing games against the AI. We suggest downloading [GoGui](http://sourceforge.net/projects/gogui/). Playing games ------------- -Once you've installed the nightly Rust compiler, Cargo, and [GoGui](http://gogui.sourceforge.net/) you can use the following shell scripts to compile the program and play games: +Once you've installed the nightly Rust compiler, Cargo, and [GoGui](http://gogui.sourceforge.net/) you can use the following shell scripts to compile the program and play games. All these scripts play a game on a 9x9 board with a time limit of 5 minutes by default. You can also play games on 13x13 and 19x19 by passing 13 or 19 as an argument to the scripts. -* `bin/play` will compile the program and start a game on a 9x9 board with a time limit of 5 minutes (sudden death) in [GoGui](http://gogui.sourceforge.net/). By default it will assign black to Iomrascálaí. The defaults can be changed easily by editing some constants in the script. -* `bin/play-gnugo` will compile the program and start a game on 9x9 with a time limit of 5 minutes (sudden death) against GnuGo. It will assign black to [GnuGo](https://www.gnu.org/software/gnugo/) and the game can be observed in [GoGui](http://gogui.sourceforge.net/). Again, the defaults (board size, time limits, etc.) can be changed by editing the script. -* `bin/play-self` will compile the program and start a game on 9x9 with a time limit of 5 minutes (sudden death) between two copies of Iomrascálaí. Just like with the other scripts the game can be observed in [GoGui](http://gogui.sourceforge.net/) and the parameters can be adjusted by editing the script. +* `bin/play` will compile the program and start a game in [GoGui](http://gogui.sourceforge.net/). By default it will assign black to Iomrascálaí. The defaults can be changed easily by editing some constants in the script. +* `bin/play-gnugo` will compile the program and start a game against GnuGo. It will assign black to [GnuGo](https://www.gnu.org/software/gnugo/) and the game can be observed in [GoGui](http://gogui.sourceforge.net/). Again, the defaults can be changed by editing the script. +* `bin/play-self` will compile the program and start a game between two copies of Iomrascálaí. Just like with the other scripts the game can be observed in [GoGui](http://gogui.sourceforge.net/) and the parameters can be adjusted by editing the script. Program parameters ------------------ @@ -36,24 +36,9 @@ planned features and bugs and [join the mailing list](https://groups.google.com/forum/#!forum/iomrascalai) and [the chat](https://gitter.im/ujh/iomrascalai) for discussion. -Resources -========= - -The following Go programs are available as source code and can serve -as inspiration: - -* [HouseBot](https://github.com/ujh/HouseBot) -* [Pachi](http://pachi.or.cz/) -* [Orego](https://github.com/Orego/Orego) -* [libego](https://github.com/lukaszlew/libego) -* [Fuego](http://sourceforge.net/projects/fuego/) -* [oakfoam](http://oakfoam.com/) -* [GnuGo](https://www.gnu.org/software/gnugo/) -* [Brown](http://www.lysator.liu.se/~gunnar/gtp/brown-1.0.tar.gz) - License ======= -Iomrascálaí is licensed under GPL v3. See the -[LICENSE file](https://github.com/ujh/iomrascalai/blob/master/LICENSE) -for the complete license text. +Iomrascálaí is licensed under GPLv3. See the +[LICENSE](https://github.com/ujh/iomrascalai/blob/master/LICENSE) +file for the complete license text. The scripts in `bin/` and `misc/clop` are licensed under the MIT license. From 09c62c2019f07de4438732325cc15227d2ff1872 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Mon, 30 Nov 2015 09:52:17 +0100 Subject: [PATCH 08/11] Add MIT copyright headers to script files --- bin/benchmark | 22 ++++++++++++++++++++++ bin/play | 22 ++++++++++++++++++++++ bin/play-gnugo | 22 ++++++++++++++++++++++ bin/play-self | 22 ++++++++++++++++++++++ bin/wins-from-benchmark-results.rb | 23 +++++++++++++++++++++++ misc/clop/lib/analyze.rb | 23 +++++++++++++++++++++++ misc/clop/lib/dir.rb | 23 +++++++++++++++++++++++ misc/clop/lib/from_assoc.rb | 24 ++++++++++++++++++++++++ misc/clop/lib/lib.rb | 23 +++++++++++++++++++++++ misc/clop/lib/run.rb | 23 +++++++++++++++++++++++ misc/clop/lib/to_toml.rb | 23 +++++++++++++++++++++++ misc/clop/runner | 22 ++++++++++++++++++++++ 12 files changed, 272 insertions(+) diff --git a/bin/benchmark b/bin/benchmark index 9dff2fe0..7f772115 100755 --- a/bin/benchmark +++ b/bin/benchmark @@ -1,4 +1,26 @@ #!/bin/bash +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. set -e diff --git a/bin/play b/bin/play index 93044c6f..4e70a622 100755 --- a/bin/play +++ b/bin/play @@ -1,4 +1,26 @@ #!/bin/bash +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. set -e diff --git a/bin/play-gnugo b/bin/play-gnugo index e42d5e37..90a8a3ec 100755 --- a/bin/play-gnugo +++ b/bin/play-gnugo @@ -1,4 +1,26 @@ #!/bin/bash +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. set -e diff --git a/bin/play-self b/bin/play-self index 0ae3b64b..75d67edc 100755 --- a/bin/play-self +++ b/bin/play-self @@ -1,4 +1,26 @@ #!/bin/bash +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. set -e diff --git a/bin/wins-from-benchmark-results.rb b/bin/wins-from-benchmark-results.rb index 2ee15855..0f87a3c7 100644 --- a/bin/wins-from-benchmark-results.rb +++ b/bin/wins-from-benchmark-results.rb @@ -1,4 +1,27 @@ # -*- coding: utf-8 -*- +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + def data(contents) contents.each_line.find_all {|l| l !~ /^#/ }.map do |l| l.split(/\s+/)[3] diff --git a/misc/clop/lib/analyze.rb b/misc/clop/lib/analyze.rb index cdae305c..600dd3c9 100644 --- a/misc/clop/lib/analyze.rb +++ b/misc/clop/lib/analyze.rb @@ -1,3 +1,26 @@ +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + def analyze(outfile:, playing_white:) File.open("#{outfile}.dat", "r") do |f| f.each_line do |line| diff --git a/misc/clop/lib/dir.rb b/misc/clop/lib/dir.rb index 9ef23f4f..0bf1c942 100644 --- a/misc/clop/lib/dir.rb +++ b/misc/clop/lib/dir.rb @@ -1,3 +1,26 @@ +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + require 'fileutils' def dir(seed:, experiment:) diff --git a/misc/clop/lib/from_assoc.rb b/misc/clop/lib/from_assoc.rb index ff3d34a3..a402355e 100644 --- a/misc/clop/lib/from_assoc.rb +++ b/misc/clop/lib/from_assoc.rb @@ -1,3 +1,27 @@ +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + # Takes an array of key value pairs and turns it into a hash of # hashes. The keys on the first level may contain dots as this is how # we'll output them with the to_toml function. diff --git a/misc/clop/lib/lib.rb b/misc/clop/lib/lib.rb index 01f3ec9c..92345df8 100644 --- a/misc/clop/lib/lib.rb +++ b/misc/clop/lib/lib.rb @@ -1,3 +1,26 @@ +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + require_relative "analyze" require_relative "dir" require_relative 'from_assoc' diff --git a/misc/clop/lib/run.rb b/misc/clop/lib/run.rb index c8b94e45..772e9af5 100644 --- a/misc/clop/lib/run.rb +++ b/misc/clop/lib/run.rb @@ -1,3 +1,26 @@ +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + def run(toml:, seed:, outfile:) File.open("config.toml", "w") {|f| f.puts toml } if rand(2).zero? diff --git a/misc/clop/lib/to_toml.rb b/misc/clop/lib/to_toml.rb index 1b3596d3..9dee8cb1 100644 --- a/misc/clop/lib/to_toml.rb +++ b/misc/clop/lib/to_toml.rb @@ -1,3 +1,26 @@ +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + def to_toml(hash) hash.map do |namespace, fields| str = "[#{namespace}]\n" diff --git a/misc/clop/runner b/misc/clop/runner index a9db5be4..b654ee1d 100755 --- a/misc/clop/runner +++ b/misc/clop/runner @@ -1,4 +1,26 @@ #!/usr/bin/env ruby +# +# Copyright (c) 2015 Urban Hafner +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, +# publish, distribute, sublicense, and/or sell copies of the Software, +# and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. require_relative 'lib/lib' From 638e35a5bb6eec6c196570d669477bbfa02c3a98 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Mon, 30 Nov 2015 13:30:14 +0100 Subject: [PATCH 09/11] Add missing links --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 97ddd7a7..90576a9a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Program parameters Many parameters of Iomrascálaí can be changed and those changes directly affect the program strength. -You set the parameters by supplying a TOML (**LINK**) formatted configuration file when starting the program with either the `-c` or `--config` command line flag. A great way to get started is to capture the output of `-d` (or `--dump`) into a file and edit the variables. This is the default configuration and lists all possible variables with their default values. See the [api documentation](http://bettong.net/iomrascalai/api/iomrascalai) for details on what these variables do. Just use the search on top and enter the name of the configuration variable. It should take you to the page that lists the struct that defines it (e.g. `PriorsConfig` for a variable in the `[priors]` block in the config file). +You set the parameters by supplying a [TOML](https://github.com/toml-lang/toml) formatted configuration file when starting the program with either the `-c` or `--config` command line flag. A great way to get started is to capture the output of `-d` (or `--dump`) into a file and edit the variables. This is the default configuration and lists all possible variables with their default values. See the [api documentation](http://bettong.net/iomrascalai/) for details on what these variables do. Just use the search on top and enter the name of the configuration variable. It should take you to the page that lists the struct that defines it (e.g. [PriorsConfig](http://bettong.net/iomrascalai/api/iomrascalai/struct.PriorsConfig.html) for a variable in the `[priors]` block in the config file). Development =========== @@ -36,6 +36,8 @@ planned features and bugs and [join the mailing list](https://groups.google.com/forum/#!forum/iomrascalai) and [the chat](https://gitter.im/ujh/iomrascalai) for discussion. +The internal documentation is available [here](http://bettong.net/iomrascalai). It can also be built locally using `cargo doc`. + License ======= From 284a65eef099e628fc3ca03ae6eabff0eb98fc9f Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Tue, 1 Dec 2015 07:22:14 +0100 Subject: [PATCH 10/11] Mention the releases --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 90576a9a..7dd8191b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,12 @@ Iomrascálaí (Gaelic for wrestler, [see here for the pronunciation](https://raw Installation ------------ -Iomrascálaí requires the latest unstable (also called nightly) Rust compiler as well as the latest Cargo. Both are generally installed when you download the installers from the [Rust homepage](https://www.rust-lang.org). You will also need a graphical interface for playing games against the AI. We suggest downloading [GoGui](http://sourceforge.net/projects/gogui/). +If you just want to play a game against the engine you can download precompiled executables of the [releases](https://github.com/ujh/iomrascalai/releases) for Mac, Linux, and Windows. You will also need a graphical interface for playing games against the AI. We suggest downloading [GoGui](http://sourceforge.net/projects/gogui/). + +Compilation +------------ + +Iomrascálaí requires the latest unstable (also called nightly) Rust compiler as well as the latest Cargo. Both are generally installed when you download the installers from the [Rust homepage](https://www.rust-lang.org). Playing games ------------- From 66fd83ca71ea6669318e2c8f76075ea55db3f800 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Tue, 1 Dec 2015 07:28:10 +0100 Subject: [PATCH 11/11] Add a code of conduct --- README.md | 4 ++-- code_of_conduct.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 code_of_conduct.md diff --git a/README.md b/README.md index 7dd8191b..8df16344 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ Development See the [issues](https://github.com/ujh/iomrascalai/issues) for planned features and bugs and [join the mailing list](https://groups.google.com/forum/#!forum/iomrascalai) -and [the chat](https://gitter.im/ujh/iomrascalai) for discussion. +and [the chat](https://gitter.im/ujh/iomrascalai) for discussion. The internal documentation is available [here](http://bettong.net/iomrascalai). It can also be built locally using `cargo doc`. -The internal documentation is available [here](http://bettong.net/iomrascalai). It can also be built locally using `cargo doc`. +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. License ======= diff --git a/code_of_conduct.md b/code_of_conduct.md new file mode 100644 index 00000000..8a17fa39 --- /dev/null +++ b/code_of_conduct.md @@ -0,0 +1,50 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating +documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic + addresses, without explicit permission +* Other unethical or unprofessional conduct + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +By adopting this Code of Conduct, project maintainers commit themselves to +fairly and consistently applying these principles to every aspect of managing +this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting a project maintainer at contact@urbanhafner.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. Maintainers are +obligated to maintain confidentiality with regard to the reporter of an +incident. + + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.3.0, available at +[http://contributor-covenant.org/version/1/3/0/][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/3/0/