A Capture The Flag (CTF) environment.
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
capture-the-flag-0.0.1.tar.gz
(61.3 kB
view hashes)
Built Distribution
Close
Hashes for capture_the_flag-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fc3db5ea1f362d6c1201de3f18c2e882abe986546de5560201bc25df6279e6e |
|
MD5 | 0b3044826b0d8652b36a2f772403f2d1 |
|
BLAKE2b-256 | d0164c444d7ccc1af3fbc5b00e00e400009ad3d85b68c4be880bede906011147 |