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
| class Rope | |
| { | |
| public HashSet<Point> VisitedPoints = new HashSet<Point>(); | |
| Point[] knots; | |
| public Rope(int knotCount) | |
| { | |
| knots = new Point[knotCount]; | |
| for(var x = 0; x < knotCount; 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
| using System.Text; | |
| static byte[] UnicodeCodepointToUtf8(int codepoint) | |
| { | |
| if (codepoint >= 0 && codepoint <= 127) | |
| { | |
| return new byte[] { (byte)codepoint }; | |
| } | |
| else if (codepoint >= 128 && codepoint <= 2047) | |
| { |
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 cv2 | |
| import pytesseract | |
| from pytesseract import Output | |
| import numpy as np | |
| import re | |
| import json | |
| # Create a JSON object with a JSON array | |
| palette = { | |
| "name": "Vallejo Panzer Aces", |
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
| # Function to parse the game data from the input text | |
| def parse_game_data(game_data): | |
| games = {} | |
| for line in game_data.strip().split('\n'): | |
| if not line.startswith('Game'): | |
| continue | |
| game_id_str, *game_reveals_list = line.replace(':', ';').split(';') | |
| game_id = int(game_id_str.split()[1]) | |
| game_reveals = [] | |
| for reveal in game_reveals_list: |
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
| """ | |
| This script simulates a game where numbers are drawn randomly between 1 and 1000 and placed into 20 slots. | |
| The goal is to place the numbers in the slots in the most optimal way to win the game. | |
| Numbers cannot be rearranged after placement and must be strictly in ascending order. | |
| The script keeps track of the number of games played and the minimum, maximum, and average number of games required to win. | |
| To see a visual representation of the game, uncomment the replay_game function call and set number of games to 1. | |
| In my testing it takes on average it takes around ~160,000 games to win one. | |
| """ |
OlderNewer