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
validInputs = ['0','1','2']; | |
spaceStates = { | |
"blank": '___', | |
"X": '_X_', | |
"O": '_O_'} | |
#Checks for a win based on what player you are and where you just made a move | |
def checkForWin(board,xPos,yPos,currentPlayer): | |
intendedState = spaceStates[currentPlayer] | |
return ( |
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
//------------------in Graphics.js | |
// Calculates angle between two 2d vec | |
function calculateAngle(u,v){ | |
return Math.acos((u[0]*v[0]+u[1]*v[1])/(magnitude(u)*magnitude(v))); | |
} | |
//Calculates magnitude | |
function magnitude(vec){ | |
var magnitude = 0; |
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
//Step 1: Import js file into the head of index.html: | |
<script src="https://cdn.jsdelivr.net/npm/webgl-obj-loader@2.0.6/dist/webgl-obj-loader.min.js"></script> | |
//Step 2: Download any OBJ files and copy the contents of each one as a variable in the JS code (use a separate file for neatness) | |
var starData = ` | |
# Blender v2.69 (sub 0) OBJ File: '20facestar.blend' | |
# www.blender.org | |
mtllib 20facestar.mtl | |
o Mesh_Mesh.015 | |
v 0.951056 0.000000 0.309017 |
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 a Python program to parse packets from a Wireshark CSV export | |
import csv | |
import operator | |
networkIPgroup = "PUT THE BEGINNING PART OF YOUR PRIVATE NETWORK IP HERE: e.g. XXX.XXX.1. " | |
myComputer = "Name of your device, either your IP or the name spit out by Wireshark's name resolution" | |
devices = [myComputer] |
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
int motorPin = 9; | |
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_SSD1306.h> | |
#include <stdio.h> | |
#include <elapsedMillis.h> | |
#include "Adafruit_MPRLS.h" |