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 is AI source for the thicc-tac-toe challenge server from PlaidCTF 2021. | |
# It's also the reference solution, since it loses to itself often enough. | |
from __future__ import print_function | |
from collections import Counter | |
import random | |
def ai(B, xo, randomize=True): | |
our_two_aways = set() | |
their_two_aways = set() | |
about_to_win = None |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(int argc, char *argv[]) { | |
printf("Hi, I'm %s\n", argv[0]); // The first "argument" is the path-to-self | |
if(argc != 2) { // argc is how long argv is, including that path-to-self | |
puts("You need to give me exactly one argument!"); | |
return -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
#!/usr/bin/python | |
from z3 import * | |
# Data must be in 32 bit chunks, because I'm lazy. | |
def z3crc32(data, crc = 0): | |
crc ^= 0xFFFFFFFF | |
for c in data: | |
for block in range(24, -1, -8): | |
crc ^= LShR(c, block) & 0xFF | |
for i in range(8): |