diff --git a/README.md b/README.md index 59d8983e..8df16344 100644 --- a/README.md +++ b/README.md @@ -5,58 +5,47 @@ 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). -Development -=========== +Installation +------------ -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. +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/). -Testing -======= +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). -To play 10 games against GnuGo, install GoGui and run the -following command in the top level folder: +Playing games +------------- -``` 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 -``` +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. -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): +* `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. -``` 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 -``` +Program parameters +------------------ -Resources -========= +Many parameters of Iomrascálaí can be changed and those changes directly affect the program strength. -The following Go programs are available as source code and can serve -as inspiration: +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 +=========== + +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. The internal documentation is available [here](http://bettong.net/iomrascalai). It can also be built locally using `cargo doc`. -* [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) +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 ======= -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. diff --git a/bin/benchmark b/bin/benchmark index de2ec466..7f772115 100755 --- a/bin/benchmark +++ b/bin/benchmark @@ -1,9 +1,30 @@ #!/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 -THREADS=8 -GAMES=300 +GAMES=500 if [ $1 == "9" ]; then TIME="5m" diff --git a/bin/play b/bin/play new file mode 100755 index 00000000..4e70a622 --- /dev/null +++ b/bin/play @@ -0,0 +1,51 @@ +#!/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 + +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" + +set -x + +gogui -computer-black -program "$IOMRASCALAI" -size $SIZE diff --git a/bin/play-gnugo b/bin/play-gnugo index 0cd487c8..90a8a3ec 100755 --- a/bin/play-gnugo +++ b/bin/play-gnugo @@ -1,13 +1,55 @@ #!/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 -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..75d67edc 100755 --- a/bin/play-self +++ b/bin/play-self @@ -1,12 +1,52 @@ #!/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 -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 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/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/ 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' 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");