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
# Rock, Paper, Scissors command line python3 game | |
# run at commandline by typing `python rock-paper-scissors.py` | |
from random import randint # import random for computer choice | |
class NotAChoiceException(Exception): # creating a custom exception to handle by inputs | |
"""doc statement about error""" | |
pass | |
def takeInput(): # the function that handles input |
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
float bend; | |
float pitch_value; | |
float divider = 38; | |
int vcaPin = 10; | |
int current; | |
void setup() { | |
usbMIDI.setHandleNoteOff(OnNoteOff); | |
usbMIDI.setHandleNoteOn(OnNoteOn); | |
usbMIDI.setHandleVelocityChange(OnVelocityChange); |
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 setup() { | |
analogWriteResolution(8); | |
} | |
void loop() { | |
int t=0; | |
for(;;t++) { | |
analogWrite(A14,(t*3 &t>>9 &t*5 &t>>9 &t*7&t>>9 )); | |
} | |
} |
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 random import random, randint | |
letters="ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
def individual(len): | |
return [letters[int(round(random()*100)%26)] for x in xrange(len)] | |
def population(size, len): | |
return [individual(len) for x in xrange(size)] |
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/env python | |
# use unittest to test if new file equals original, will | |
# fail test if it does not. | |
import unittest | |
# Get the file name of 'this' file. Will be 'file.py' | |
ORIG_FILE_NAME = __file__ | |
# Get the contents of the ORIGINAL FILE file. |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
let mapleader = "," | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'vim-airline/vim-airline' | |
Plugin 'flazz/vim-colorschemes' |