Skip to content

Instantly share code, notes, and snippets.

View prail's full-sized avatar
😎
bing chilling

Andrew Teesdale, Jr. prail

😎
bing chilling
View GitHub Profile
@prail
prail / tictactoe.c
Created October 9, 2024 17:23
AI tictactoe tourney
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 3
#define MAX_PLAYERS 10
// Thresholds for cheating detection
#define MAX_SAME_CHAR_COUNT 3 // Allow up to 4 instances of the same character in suspicious patterns
#define CHEATING_PENALTY -1 // Deduct a win for cheating
@prail
prail / pcc_stalker_dir.user.js
Created November 14, 2021 03:10
PCC Stalker Directory
// ==UserScript==
// @name Stalker Directory
// @version 1.0
// @description Adds images to the PCC student (stalker) directory.
// @author Andrew
// @match https://eaglesnest.pcci.edu/studentservices/studentdirectory/
// @icon https://www.google.com/s2/favicons?domain=pcci.edu
// @grant none
// ==/UserScript==
@prail
prail / changed.html
Last active August 4, 2024 03:33
Handbook Diffchecker
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
max-width: 800px;
margin: 0 auto;
}
@prail
prail / class_filter.awk
Created July 27, 2024 17:15
Eagles Nest Class Calendar Filter/Generator
# ICS file filter
BEGIN {
FS = ":"
buffer = ""
notevent = 0
}
($1~/^BEGIN/ && $2~/VEVENT/) {
keep = 1;
}
@prail
prail / banner_gen.py
Created April 9, 2023 22:19
Generates banner comments for CS227 programs
#!/usr/bin/python3
from sys import argv,exit
if len(argv) != 2: exit(1)
MAX_WIDTH = 72
print('/'+'*'*(MAX_WIDTH - 2)+'/\n/*{}*/'.format(argv[1].center(MAX_WIDTH-4))+'\n/'+'*'*(MAX_WIDTH - 2)+'/')
@prail
prail / center_banners.py
Last active April 9, 2023 22:17
Centers banner comments in CS227 programs
#!/usr/bin/python3
"""
This script finds all banner comments in a Howell (CS227) program and perfectly
centers them, so you won't get any points off on your programs for that.
Prints out the contents of the program just to be safe.
Andrew Teesdale, Jr. (f40c40.com)
"""
import sys
@prail
prail / polyglot.bat
Created October 23, 2017 17:00
Bash and Batch polyglot. (Really nice for build scripts that need to support multiple platforms.)
echo off
echo ; set +v # > NUL
echo ; function GOTO { true; } # > NUL
GOTO WIN
# bash part, replace it to suit your needs
exit 0
:WIN
REM win part, replace it to suit your needs
@prail
prail / nitrobot.user.js
Last active March 22, 2022 00:04
Bot for nitrotype.com. Please see comments below for guide on how to use.
// ==UserScript==
// @name Nitrobot
// @namespace http://ateesdalejr.tk
// @version 1.0
// @description Try to take over nitrotype!
// @author Andrew T.
// @match https://www.nitrotype.com/*
// @grant none
// ==/UserScript==
@prail
prail / magicFluffyUnicorn.user.js
Last active August 2, 2020 18:37
Simple userscript for commenting nice when you love a project.
// ==UserScript==
// @name magicFluffyUnicorn
// @namespace http://tampermonkey.net/
// @version 1.2
// @description Does cool magic fluffy unicorn kind of stuff.
// @author @TheUltimatum, @bob1171
// @match https://scratch.mit.edu/projects/*
// @grant none
// ==/UserScript==
@prail
prail / SB.BNF
Last active March 11, 2018 02:58
BNF (sortof) grammar for SmileBASIC.
FULLEXPRESSION -> [ EXPRESSION ]
EXPRESSION -> "(" EXPRESSION ")" || VALUE [ OPERATOPERATOR EXPRESSION ] || UNARYOP SMALLEXPRESSION
SMALLEXPRESSION -> "(" EXPRESSION ")" || VALUE || UNARYOPERATOR [ SMALLEXPRESSION ]
CONSTANTEXPRESSION -> CONSTANT || "(" CONSTANTEXPRESSION ")" || CONSTANT [ CONSTANTOPERATOR CONSTANTEXPRESSION ] || CONSTANTUNARYOPERATOR SMALLCONSTANTEXPRESSION || STRING
SMALLCONSTANTEXPRESSION -> "(" CONSTANTEXPRESSION ")" || CONSTANT || CONSTANTUNARYOPERATOR [ SMALLCONSTANTEXPRESSION ]
CONSTANT -> NUMBER || "PI" "(" ")" || "#RED" etc.
UNARYOPERATOR -> "-" || "NOT" || "!"
OPERATOR -> "+" || "-" || etc.