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
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
// Current Cards | |
// Mountain | |
// Future Cards |
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
void groupDefenders(vector<vector<int>> attackers, vector<int> defenders, int i) { | |
int x = 0; | |
for (vector<int> attackerBucket:attackers) { | |
cout << x << ": "; | |
for (int defender:attackerBucket) { | |
cout << defender << " "; | |
} | |
cout << "\n"; | |
x+= 1; | |
} |
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
/* | |
This method prints all possible blocks, recursively. | |
For example, if you have blockers A & B, and attacker C, there are three posible blocks. | |
No blockers: | |
A: | |
B: | |
C blocks A: |
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
/* | |
Print out all ways for attackers to be blocked. blockAssignments maps ids of attackers to | |
vectors of defender ids for which blocks have already been chosen. defenders/defendersIterator specify | |
defenders that could block any of the attackers. This method iterates over all ways to choose blocks for | |
the remaining defenders. | |
example input: groupDefenders({0:[2 3] 1:[4 5]}, [6 7 8 9], 3) | |
output: |
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
from segments.huggingface import release2dataset | |
from segments import SegmentsClient | |
dataset_identifier = "andrewljohnson/magic_cards" | |
release_name = "v0.1" | |
api_key = "HIDDEN" | |
client = SegmentsClient(api_key) # this is different from blog, blog seemed outdated | |
release = client.get_release(dataset_identifier, release_name) | |
hf_dataset = release2dataset(release) | |
from segments.utils import get_semantic_bitmap |
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
from bs4 import BeautifulSoup | |
import pandas as pd | |
with open('magiccon.html', 'r', encoding='utf-8') as file: | |
html_data = file.read() | |
soup = BeautifulSoup(html_data, 'html.parser') | |
# Initialize lists to store data | |
data = { | |
'Title': [], |
OlderNewer