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
| # Speed Build Analysis for 6-star Monsters in Summoners War | |
| # This script analyzes the provided JSON data to determine how many 6-star monsters can reach a target speed (e.g., 200) using specific rune set combinations, while considering various constraints. | |
| # Key Features: | |
| # - Parses all runes (both inventory and equipped) to calculate their speed contributions. | |
| # - Sorts monsters by their base speed and attempts to find optimal rune builds for each. | |
| # - Categorizes monsters based on the rune set combinations used in their builds. | |
| # - Provides flexibility in analysis through parameters like allowing used runes, using average base speed, and prioritizing broken sets. | |
| # Note: This script assumes that the JSON structure is consistent with the provided format and that the necessary fields are present. | |
| # Uses Requirement-First approach to optimize rune selection and minimize redundant calculations. |
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 bs4 import BeautifulSoup, SoupStrainer | |
| import requests | |
| import os | |
| import urllib | |
| # Could be .png or other image type. | |
| match_str = '.webp' | |
| # Access many links in sequence. |
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 count_walks(graph, u, v, k): | |
| if(k == 0 and u == v): return 1 | |
| if(k == 1 and graph[u][v]): return 1 | |
| if(k <= 0): return 0 | |
| count = 0 | |
| for i in range(0, 5): | |
| if(graph[u][i]): | |
| count += count_walks(graph, i, v, k-1) |
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 rauth.service import OAuth1Service, OAuth1Session | |
| # Get a real consumer key & secret from: http://www.goodreads.com/api/keys | |
| key = '<API_KEY>' | |
| secret = '<API_SECRET>' | |
| goodreads = OAuth1Service( | |
| consumer_key=key, | |
| consumer_secret=secret, | |
| name='goodreads', | |
| request_token_url='http://www.goodreads.com/oauth/request_token', |
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
| #first attempt at implementing horizon plots in ggplot2 | |
| #pleased with result but code sloppy and inflexible | |
| #as always very open to improvements and forks | |
| if(!require(reshape2)){ | |
| install.packages("reshape2") | |
| } | |
| if(!require(quantmod)){ | |
| install.packages("quantmod") | |
| } | |
| if(!require(PerformanceAnalytics)){ |