Идея: дать игроку возможность сыграть с компьютером ровно своего
уровня. Для этого нужно откалибровать параметры движка (Skill Level,
Depth, Timeout) так, чтобы профиль ошибок движка соответствовал
профилю игроков с целевым рейтингом.
This file contains hidden or 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
| numbers = [] | |
| k = 3 | |
| x = 0.4142135623730950488 # 2**0.5 - 1 | |
| for i in range(1, k): | |
| j = 10**i | |
| n = 1 / j | |
| c = x * j |
This file contains hidden or 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
| #include <Servo.h> | |
| #define PIN_PHOTO_SENSOR A0 | |
| #define PIN_SERVO 11 | |
| #define LIGHT_LIMIT_K 80 | |
| #define MAX_POSITIVE_SPEED 180 | |
| #define MAX_NEGATIVE_SPEED 0 | |
| #define REST_SPEED 90 |
This file contains hidden or 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
| from manim import * | |
| class Sample(Scene): | |
| def construct(self): | |
| ellipse1 = Ellipse( | |
| width=4.0, height=5.0, fill_opacity=0.5, color=BLUE, stroke_width=10 | |
| ).move_to(LEFT) | |
| ellipse2 = ellipse1.copy().set_color(RED).move_to(RIGHT) |
This file contains hidden or 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
| # Based on https://www.youtube.com/watch?v=u8zLAUroUq8&ab_channel=WildMathing | |
| from manim import * | |
| from numpy.random import uniform | |
| # WORDS = ( | |
| # r"e^{i/pi}+1=0", | |
| # r"3^2+4^2=5^2", | |
| # r"V+F-E=2", | |
| # r"\exists", |
This file contains hidden or 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 TelegramBot from "node-telegram-bot-api"; | |
| export type UseHandler<ContextType> = ( | |
| message: TelegramBot.Message | undefined, | |
| metadata: TelegramBot.Metadata | undefined, | |
| query: TelegramBot.CallbackQuery | undefined, | |
| context: ContextType, | |
| next: () => void | |
| ) => void; |
This file contains hidden or 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 merge_sort(array: list): | |
| length = len(array) | |
| buff = [0 for _ in range(length)] | |
| def merge_sort_master(start_index, finish_index): | |
| size = finish_index - start_index + 1 | |
| if size < 2: | |
| return |
This file contains hidden or 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 quick_sort(array: list): | |
| def quick_sort_master(start_index, finish_index): | |
| pivot = array[(start_index + finish_index) // 2] | |
| left_index = start_index | |
| right_index = finish_index | |
| while left_index <= right_index: | |
| while array[left_index] < pivot: | |
| left_index += 1 | |
| while array[right_index] > pivot: |
This file contains hidden or 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
| const getType = (x: any) => Object.prototype.toString.call(x).slice(8, -1); | |
| // prettier-ignore | |
| const primitiveTypes = ["Number", "String", "Boolean", "Null", "BigInt", 'Symbol', 'Undefined']; | |
| const isPrimitiveType = (x: any) => primitiveTypes.includes(getType(x)); | |
| export const getCopy = (x: any) => { | |
| if (isPrimitiveType(x)) { | |
| return x; | |
| } |
This file contains hidden or 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
| // https://www.codewars.com/kata/5296bc77afba8baa690002d7 | |
| const puzzle = [ | |
| [5, 3, 0, 0, 7, 0, 0, 0, 0], | |
| [6, 0, 0, 1, 9, 5, 0, 0, 0], | |
| [0, 9, 8, 0, 0, 0, 0, 6, 0], | |
| [8, 0, 0, 0, 6, 0, 0, 0, 3], | |
| [4, 0, 0, 8, 0, 3, 0, 0, 1], | |
| [7, 0, 0, 0, 2, 0, 0, 0, 6], | |
| [0, 6, 0, 0, 0, 0, 2, 8, 0], |
NewerOlder