Skip to main content

Python code to assist the game Olympia

Project description

olypy

Build Status Coverage Status Apache License 2.0

olypy is a collection of code related to the epic fantasy strategy game Olympia, which currently lives in SVN (yuck) at

https://sourceforge.net/projects/olympiag3/

olypy supports:

  • Generating a game database for testing the Olympia code
  • Actual end-to-end tests of the Olympia code
  • Generating a game database from player turn output to support simulations for players

Installing

Install python 3.5 or better, using pyenv or your favorite equivalent.

Clone the repo.

Install dependent python modules, and see if olypy passes tests:

python -m pip install -r requirements.txt
make test

Generating the QA database

make defaultlib

Running Olympia tests

You need a compiled Olympia binary with support for the 'assert' command.

cd sim; python run-tests.py

Tests are YAML files. Here's an example:

description: test move-related things
lib: defaultlib
aa1 orders: |
 unit 1102  # A2 in Aachen [c18]
   # test movement delays
   claim 10 20
   assert item 10 20 not item 10 21 # exactly 20
   move out # 2 days
   assert day 3 not day 4
   drop 10 1
   move c18
   assert day 4 not day 5

This example contains 3 tests. assert is similar to wait; it passes if the wait is 0-time, and fails elsewise. The foo not foo syntax is a way of expressing exact values.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

olypy-0.9.43-py3-none-any.whl (334.6 kB view details)

Uploaded Python 3

File details

Details for the file olypy-0.9.43-py3-none-any.whl.

File metadata

  • Download URL: olypy-0.9.43-py3-none-any.whl
  • Upload date:
  • Size: 334.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1

File hashes

Hashes for olypy-0.9.43-py3-none-any.whl
Algorithm Hash digest
SHA256 7987de62e0fa73110cb2f2927a25a3e14451713fedebd5600323c8f4099154f0
MD5 494c17fd18f82fd5cf016e6aced73cd6
BLAKE2b-256 ed21552cd9ac128fce157d96ab88463eb29e3ad228b892a9f4f92d38f298577c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page