capture-the-flag-0.0.4
توضیحات
A Capture The Flag (CTF) environment.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | capture-the-flag-0.0.4 |
| نام | capture-the-flag |
| نسخه کتابخانه | 0.0.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Christian Lang |
| ایمیل نویسنده | me@christianlang.io |
| آدرس صفحه اصلی | https://github.com/documentedai/capture-the-flag |
| آدرس اینترنتی | https://pypi.org/project/capture-the-flag/ |
| مجوز | BSD |
# Capture The Flag (CTF)
[](https://pypi.org/project/capture-the-flag/)
[](https://pypi.org/project/capture-the-flag/)
[](https://github.com/documentedai/capture-the-flag/blob/master/LICENSE)
[](https://github.com/documentedai/capture-the-flag/actions?query=branch%3Amaster)
[](https://codecov.io/gh/documentedai/capture-the-flag)
Capture The Flag (CTF) is a Python package for reinforcement learning. This package is not related to [CTF Hacking](https://en.wikipedia.org/wiki/Capture_the_flag#Computer_security) competitions.
## Installation
```
pip install capture-the-flag
```
## Dependencies
- [numpy](https://www.numpy.org)
- [pyglet](http://www.pyglet.org)
## Usage
For a random game.
```python
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](https://capture-the-flag.readthedocs.io/en/latest/)
نیازمندی
| مقدار | نام |
|---|---|
| - | numpy |
| - | pyglet |
| - | sphinx |
| - | pytest |
| - | pytest-cov |
| - | flake8 |
نحوه نصب
نصب پکیج whl capture-the-flag-0.0.4:
pip install capture-the-flag-0.0.4.whl
نصب پکیج tar.gz capture-the-flag-0.0.4:
pip install capture-the-flag-0.0.4.tar.gz