This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def elo(ra, rb, sa, sb, ka, kb): | |
''' | |
you can find the description here https://safoyeth.com/2017/03/04/chessscripts/ | |
ra/rb - current rating. Python 2.x note - values must be float | |
sa/sb - result (1 for win, 1/2 for draw, 0 for lose) | |
ka/kb = 10 if ra/rb >= 2400 | |
ka/kb = 20 if ra/rb < 2400 | |
ka/kb = 40 if gamesPlayed < 30 or (age < 18 and ra/rb < 2300) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def circle(*players): | |
''' | |
you can find the description here https://safoyeth.com/2017/03/04/chessscripts/ | |
''' | |
if isinstance(players, tuple): | |
players = list(players) | |
if not len(players) % 2 == 0: | |
players.append(None) | |
result = [[["", ""] for _ in range(int(len(players)/2))] for i in range(int(len(players)-1))] | |
for each in result: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CircleSystem.cpp: определяет точку входа для консольного приложения. | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
#include <Windows.h> | |
#include <vector> | |
#include <string> | |
using namespace std; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.