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.3.tar.gz
(55.7 kB
view hashes)
Built Distribution
Close
Hashes for capture_the_flag-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6093fe542c91400fedfa7a182e466b8a1e41fb9121f5547a89780b910a49e5d |
|
MD5 | 899c59ed59add3bc2396266a5187ee3b |
|
BLAKE2b-256 | 97c3724d6e5188a0d9365cdf0055ce102b4a8ae6316ce1073c78a8f7166a37c8 |