Skip to content

Instantly share code, notes, and snippets.

View stixson99's full-sized avatar

Terry Stickney stixson99

View GitHub Profile
@stixson99
stixson99 / counterdowns.py
Created January 7, 2017 13:40
Counterdowns. Similar to the tv program but with no actual countdown. Importing random and a dictionary
#counterdowns by Terry Stickney for use by all especially pythoneers.
#dictionary may be old. Beware.
import random
def check(fname, txt):
with open(fname) as dataf:
return any(txt in line for line in dataf)
@stixson99
stixson99 / theory.py
Created January 5, 2017 20:35
Rosies Theory Programme in Python using random and arrays
import random
print ("Rosie's Theory Testing page")
print("---------------------------")
questions=["accelerando","adagio","allegretto","allegro","andante","cantabile","crescendo","da capo","dal segno","decrescendo","diminuendo","fine","fort","fortissimo","legato","lento","mezzo","messo forte","messa piano","moderato","piano","pianissimo","poco","rallentando","ritardando","ritenuto","staccato","tempo"]
answers=["gradually getting quicker","slow","fairly quick","quick","at a medium","in a singing style","gradually getting louder","repeat from the beginning","repeat from the sign","gradually getting quieter","gradually getting quieter","the end","loud","very loud","smoothly","slow","half","moderately loud","moderately quiet","moderately","quiet","very quiet","a little","gradually getting slower","gradually getting slower","held back","detached","speed"]
youranswer='yes'
<?PHP
if (isset($_REQUEST['message'])){
$trans='';
if ($_REQUEST['code']=='code'){
for ($a=0;$a<strlen($_REQUEST['message']);$a++){
$thisord=ord($_REQUEST['message'][$a]." ");
$thisord=$thisord-5;
$trans.=chr($thisord);
@stixson99
stixson99 / coderdecoder.py
Created January 3, 2017 20:01
Python text coder decoder Very Basic
#Python Coder Decoder Basic Skills using Python and understanding ASCII coding. Fully working.
#If you are using Python 3, please put brackets around the print statements, e.g. print ("----------------") AND change raw_input to just input
phrase='x' # make sure this has something inside it to keep the loop running
cchange=5 #this is the number relating to the ascii code.
while phrase != '':#start the loop. Enter blank to quit loop