Coder Social home page Coder Social logo

lunathanael / botris-interface Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 980 KB

A performant library designed for creating and managing bots in a Tetris-like game environment. This library offers various tools and features to build, test, and deploy bots efficiently to Botris.

Home Page: https://pypi.org/project/botris-interface/

License: MIT License

Python 100.00%

botris-interface's Introduction

botris-interface

GitHub license GitHub issues GitHub stars GitHub forks

botris-interface is a performant library designed for creating and managing bots in a Tetris-like game environment. This library offers various tools and features to build, test, and deploy bots efficiently to Botris.

Installation

To install the library, use the following command:

pip install botris-interface

Usage

Creating a Bot

To create a bot, you need to implement the Bot interface provided by the library. Here is an example:

from botris.bots import Bot

class CoolBot(Bot):
    async def analyze(
        self, game_state: GameState, players: List[PlayerData]
    ) -> Awaitable[List[Command]]:
        # Implement your bot logic here
        pass

Running the TetrisGame

You can run the TetrisGame using the following code:

from botris import TetrisGame
from botris.engine import Move

gs = TetrisGame()
gs.execute_move(Move.move_left)

Connecting a Bot to the Server

To connect your bot to the server, use the following code:

import asyncio
from botris import Interface

async def main():
    bot = MyBot()
    itf = Interface.create(TOKEN, ROOM_KEY, bot)
    await itf.connect()

asyncio.run(main())

License

This project is licensed under the MIT License - see the LICENSE file for details.

GitHub Repository

For more information, visit our GitHub repository.

botris-interface's People

Contributors

lunathanael avatar

Stargazers

 avatar

Watchers

 avatar

botris-interface's Issues

Feautr: Possible optimizations for movegen.

In the future, compiles frameworks and languages such as Rust, C++, or Cython could be used to increase movegen speeds.

This is not exactly my strong suit so I am asking publicly for support on this. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.