Capture The Flag (CTF)
Capture The Flag (CTF) is a Python package for reinforcement learning. This package is not related to CTF Hacking competitions.
Installation
pip install capture-the-flag
Dependencies
Usage
For a random game.
import random
import time
import ctf
game = ctf.Ctf()
game.new_game()
fps = 30
while not game.winner:
for unit in game.need_to_move:
started = time.time()
game.render()
legal_moves = game.legal_moves()
game.move(unit=unit, direction=random.choice(legal_moves[unit]))
finished = time.time()
sleeptime = 1.0/fps - (finished - started)
if sleeptime > 0:
time.sleep(sleeptime)
print(game.board)
print(game.score)
print(game.winner)
Documentation
Release files for capture-the-flag 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| capture-the-flag-0.0.4.tar.gz | 56.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capture_the_flag-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 118.5 kB
Release files / capture-the-flag-0.0.4.tar.gz
| Download URL | capture-the-flag-0.0.4.tar.gz |
|---|---|
| Size | 56.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3cb9a8736e6edf20dd626f2411dea723d2e6f9dab3b5cdaf37752e8c5264478
|
|
BLAKE2b-256 checksum How to use checksums |
0331b7fcc72c846ccc56f496be9182ab84443f26a299c481fe0560cb46f65da8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Release files / capture_the_flag-0.0.4-py3-none-any.whl
| Download URL | capture_the_flag-0.0.4-py3-none-any.whl |
|---|---|
| Size | 61.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07fd09b5a702444e64f0c9e6267dc16ae00352114d62eba64cdcc87d4dcf0527
|
|
BLAKE2b-256 checksum How to use checksums |
a425cf0bcdbffb71989707482bdcf3424fbca3eba51463e06b332926bf282cf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|