diff --git a/.gitignore b/.gitignore index 85833e0..635f2a2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ private __pycache__ *.out node_modules +*.csv diff --git a/assets/dailyprogrammer.gif b/assets/daily-programmer.gif similarity index 100% rename from assets/dailyprogrammer.gif rename to assets/daily-programmer.gif diff --git a/assets/ri.jpg b/assets/royal-institute.jpg similarity index 100% rename from assets/ri.jpg rename to assets/royal-institute.jpg diff --git a/challenges/daily-programmer/readme.md b/challenges/daily-programmer/readme.md index 4f3bb72..8b299fb 100644 --- a/challenges/daily-programmer/readme.md +++ b/challenges/daily-programmer/readme.md @@ -1,5 +1,5 @@
- +

r/dailyprogrammer

diff --git a/challenges/euler/package.json b/challenges/euler/package.json index 3cdb26c..eb97710 100644 --- a/challenges/euler/package.json +++ b/challenges/euler/package.json @@ -1,5 +1,6 @@ { "name": "project-euler", + "private": true, "scripts": { "build": "gulp build", "start": "node scripts/run", diff --git a/challenges/euler/readme.md b/challenges/euler/readme.md index 8599d27..838e4d6 100644 --- a/challenges/euler/readme.md +++ b/challenges/euler/readme.md @@ -32,7 +32,7 @@ The source code can be found in the [src](src) directory. My thoughts about some - [x] [18 - Maximum path sum I](src/18%20-%20Maximum%20path%20sum%20I.ts) - [x] [19 - Counting Sundays](src/19%20-%20Counting%20Sundays.ts) - [x] [20 - Factorial digit sum](src/20%20-%20Factorial%20digit%20sum.ts) -- [x] [21 - Amicable numbers](src/21%20-%20Amicable%20numbers.ts) +- [ ] 21 - Amicable numbers - [ ] 22 - Names scores - [ ] 23 - Non-abundant sums - [ ] 24 - Lexicographic permutations diff --git a/challenges/euler/scripts/generate.js b/challenges/euler/scripts/generate.js index e173922..539ba1b 100644 --- a/challenges/euler/scripts/generate.js +++ b/challenges/euler/scripts/generate.js @@ -4,6 +4,7 @@ const path = require('path'); const { root, src, thoughts: thoughtsDir } = require('../constants'); const axios = require('axios'); const cheerio = require('cheerio'); +const chalk = require('chalk'); process.argv.shift(); process.argv.shift(); @@ -25,17 +26,13 @@ if (isNaN(process.argv[0])) validate: input => { input = parseInt(input); - if (input > 100) return 'Please make sure you choose a number between 1 and 100!'; - else { - let alreadyGenerated = false; - fs.readdirSync(src).forEach(file => { - if (file.startsWith(input)) alreadyGenerated = true; - }); + let alreadyGenerated = false; + fs.readdirSync(src).forEach(file => { + if (file.startsWith(input)) alreadyGenerated = true; + }); - if (alreadyGenerated) - return 'Please choose a problem you have not already completed!'; - else return true; - } + if (alreadyGenerated) return 'Please choose a problem you have not already completed!'; + else return true; } }); @@ -54,41 +51,69 @@ inquirer const fileName = `${problemNumber} - ${problems[problemNumber - 1]}`; // Fetch the problem data off of projecteuler.net - axios.get(`https://projecteuler.net/problem=${problemNumber}`).then(({ data }) => { - const $ = cheerio.load(data); - const problemContent = $('.problem_content') - .text() - .trim() - .split('\n') - .map(r => `// ${r}`) - .join('\n'); + axios + .get(`https://projecteuler.net/problem=${problemNumber}`) + .then(({ data }) => { + const $ = cheerio.load(data); + const problemContent = $('.problem_content') + .text() + .trim() + .split('\n') + .map(r => `// ${r}`) + .join('\n'); - // Generate the source file - fs.writeFileSync( - path.join(src, `${fileName}.ts`), - `${problemContent} + // Generate the source file + fs.writeFileSync( + path.join(src, `${fileName}.ts`), + `${problemContent} export = {}; // Output console.log();` + ); + + // Generate the thoughts file + if (thoughts) + fs.writeFileSync( + path.join(thoughtsDir, `${fileName}.md`), + `
+ +### ${problems[problemNumber - 1]} +
` + ); + + // Check it off in the readme + const regex = new RegExp(` \\[.\\] ${problemNumber} - .*`); + const match = readmeContent.match(regex); + + let newLine = ` [x] [${match[0] + .replace('[ ]', '') + .trim()}](src/${encodeURIComponent(fileName)}.ts)`; + + if (thoughts) + newLine += `\n - [Thoughts](thoughts/${encodeURIComponent(fileName)}.md)`; + + const newContent = readmeContent.replace(regex, newLine); + + fs.writeFileSync(path.join(root, 'readme.md'), newContent); + + // If the problem's ID is greater than 100, add it to the gitignore + if (problemNumber > 100) { + const gitignorePath = path.join(root, '.gitignore'); + const gitignoreContent = fs.readFileSync(gitignorePath).toString(); + let newContent = `${gitignoreContent}\nsrc/${fileName}.ts`; + if (thoughts) newContent += `\nthoughts/${fileName}.md`; + + fs.writeFileSync(gitignorePath, newContent); + } + }) + .catch(() => + console.error( + chalk.red( + chalk.bold( + 'There was an error generating files for that challenge - please ensure that it exists on Project Euler!' + ) + ) + ) ); - - // Generate the thoughts file - if (thoughts) fs.writeFileSync(path.join(thoughtsDir, `${fileName}.md`), ''); - - // Check it off in the readme - const regex = new RegExp(` \\[.\\] ${problemNumber} - .*`); - const match = readmeContent.match(regex); - - let newLine = ` [x] [${match[0].replace('[ ]', '').trim()}](src/${encodeURIComponent( - fileName - )}.ts)`; - - if (thoughts) - newLine += `\n - [Thoughts](thoughts/${encodeURIComponent(fileName)}.md)`; - - const newContent = readmeContent.replace(regex, newLine); - - fs.writeFileSync(path.join(root, 'readme.md'), newContent); - }); }); diff --git a/challenges/euler/thoughts/10 - Summation of primes.md b/challenges/euler/thoughts/10 - Summation of primes.md index a33a6a8..23873ae 100644 --- a/challenges/euler/thoughts/10 - Summation of primes.md +++ b/challenges/euler/thoughts/10 - Summation of primes.md @@ -1,3 +1,5 @@ +
+ ### Sieve of Eratosthenes Psuedocode [Source](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Pseudocode) @@ -17,3 +19,5 @@ algorithm Sieve of Eratosthenes is return all i such that A[i] is true. ``` + +
diff --git a/challenges/euler/thoughts/15 - Lattice paths.md b/challenges/euler/thoughts/15 - Lattice paths.md index 98fe247..05e03d0 100644 --- a/challenges/euler/thoughts/15 - Lattice paths.md +++ b/challenges/euler/thoughts/15 - Lattice paths.md @@ -1,9 +1,17 @@ +
+ +### Lattice Paths + For a lattice with dimensions m x n, all paths will have m + n segments. m segments go down, n segments go right. To count m + n slots, count the ways to pick m downward moves - the rest will be rightward moves. -![](assets/15.svg) +

-### LaTeX + + +#### LaTeX ``` {m + n \choose m} = {m + n \choose n} = \frac{(m+n)!}{m!n!} ``` + +
diff --git a/challenges/euler/thoughts/9 - Special Pythagorean triplet.md b/challenges/euler/thoughts/9 - Special Pythagorean triplet.md index edfb935..f75b90b 100644 --- a/challenges/euler/thoughts/9 - Special Pythagorean triplet.md +++ b/challenges/euler/thoughts/9 - Special Pythagorean triplet.md @@ -1,26 +1,24 @@ -a + b + c = 1000, so what is abc? +
-a pythagorean triplet must make a < b < c +### Proof -we know that: +> let x be the sum -![](assets/pythagoras.svg) - -let x be the sum - -![](assets/9.svg) + ### LaTeX ``` -c = x - (a + b) \newline -a^2 + b^2 = (x - (a + b))^2 \newline -a^2 + b^2 = a^2 + 2ab - 2ax + b^2 - 2bx + x^2 \newline -2ab - 2ax - 2bx + x^2 = 0 \newline -\newline -2bx - 2ab = x^2 - 2ax \newline -(\frac{x^2}{x}) - 2a = 2b - (\frac{2ab}{x}) \newline --2a = 2b - (\frac{2ab}{x}) - (\frac{x^2}{x}) \newline -\newline +c = x - (a + b) \\ +a^2 + b^2 = (x - (a + b))^2 \\ +a^2 + b^2 = a^2 + 2ab - 2ax + b^2 - 2bx + x^2 \\ +2ab - 2ax - 2bx + x^2 = 0 \\ +\\ +2bx - 2ab = x^2 - 2ax \\ +(\frac{x^2}{x}) - 2a = 2b - (\frac{2ab}{x}) \\ +-2a = 2b - (\frac{2ab}{x}) - (\frac{x^2}{x}) \\ +\\ a = \frac{2bx - x^2}{2x - 2b} ``` + +
diff --git a/challenges/euler/thoughts/assets/15.svg b/challenges/euler/thoughts/assets/15.svg deleted file mode 100644 index ea2dd92..0000000 --- a/challenges/euler/thoughts/assets/15.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/challenges/euler/thoughts/assets/9.svg b/challenges/euler/thoughts/assets/9.svg deleted file mode 100644 index af01d8d..0000000 --- a/challenges/euler/thoughts/assets/9.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/challenges/euler/thoughts/assets/pythagoras.svg b/challenges/euler/thoughts/assets/pythagoras.svg deleted file mode 100644 index 265db04..0000000 --- a/challenges/euler/thoughts/assets/pythagoras.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/languages/c/algorithms/binary-search.c b/languages/c/algorithms/binary-search.c deleted file mode 100644 index e69de29..0000000 diff --git a/languages/c/calculators/helpers/factorial.c b/languages/c/calculators/helpers/factorial.c deleted file mode 100644 index 68db1e3..0000000 --- a/languages/c/calculators/helpers/factorial.c +++ /dev/null @@ -1,9 +0,0 @@ -int factorial(int n) { - int ans = 1; - - for (int i = 2; i <= n; i++) { - ans *= i; - } - - return ans; -} diff --git a/languages/c/calculators/ncr.c b/languages/c/calculators/ncr.c deleted file mode 100644 index aee367c..0000000 --- a/languages/c/calculators/ncr.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include "helpers/factorial.c" - -int nCr(int n, int r) { - return factorial(n) / factorial(r) * factorial(n - r); -} - -void main() { - int n; - int r; - - printf("Please enter n: "); - scanf("%i", &n); - - printf("Please enter r: "); - scanf("%i", &r); - - int ans = nCr(n, r); - printf("The answer is: %i", ans); -} diff --git a/languages/java/calculators/ncr.java b/languages/java/calculators/ncr.java deleted file mode 100644 index b5bebe1..0000000 --- a/languages/java/calculators/ncr.java +++ /dev/null @@ -1,47 +0,0 @@ -package calculators; -import java.util.InputMismatchException; -import java.util.Scanner; - -class CombinationCalculator { - private static Scanner scanner = new Scanner(System.in); - - private static int factorial(int n) { - int res = 1; - - for (int i = 2; i <= n; i++) { - res *= i; - } - - return res; - } - - private static int nCr(int n, int r) { - return factorial(n) / (factorial(r) * factorial(n - r)); - } - - private static int intInput(String message) { - int value = -1; - - while (value < 0) { - try { - System.out.print(message); - value = scanner.nextInt(); - } catch (InputMismatchException e) { - scanner.next(); - } - } - - return value; - } - - public static void main(String[] args) { - // Take inputs - int n = intInput("Please input the value for n: "); - int r = intInput("Please input the value for r: "); - scanner.close(); - - // Calculate the result - int result = nCr(n, r); - System.out.println(result); - } -} diff --git a/languages/python/calculators/SQRT.py b/languages/python/calculators/Babylonian Square Root.py similarity index 58% rename from languages/python/calculators/SQRT.py rename to languages/python/calculators/Babylonian Square Root.py index 0756e50..df0e81c 100644 --- a/languages/python/calculators/SQRT.py +++ b/languages/python/calculators/Babylonian Square Root.py @@ -5,11 +5,11 @@ Created as a part of my Royal Institute masterclass from _helpers import intInput -def sqrt(x): - a = 2 - while abs((a - (x / a))) > 1: - a = (a + (x / a)) / 2 - return int(a) +def sqrt(number): + initialGuess = 2 + while abs(initialGuess - (number / initialGuess)) > 1: + initialGuess = (initialGuess + (number / initialGuess)) / 2 + return int(initialGuess) num = intInput('Please input a number! (:') res = sqrt(num) diff --git a/languages/python/calculators/Binomial Expansion.py b/languages/python/calculators/Binomial Expansion.py new file mode 100644 index 0000000..84656af --- /dev/null +++ b/languages/python/calculators/Binomial Expansion.py @@ -0,0 +1,50 @@ +# (a + b) ^ n +superscript = ['⁰', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹'] + +def factorial(n): + ans = 1 + for i in range(2, n + 1): + ans *= i + return ans + +def nCr(n, r): + return factorial(n) / (factorial(r) * factorial(n - r)) + +while True: + try: + n = int(input('Please enter a power to put (a + b) to! ')) + break + except ValueError: + print('The power must be a valid integer!') + continue + +terms = [] + +for r in range(n + 1): + a = n - r + b = r + c = int(nCr(n, r)) + term = '' + + if c != 1: + term += str(c) + + if a != 0: + term += 'a' + if a != 1: + power = '' + for digit in str(a): + power += superscript[int(digit)] + term += power + + if b != 0: + term += 'b' + if b != 1: + power = '' + for digit in str(b): + power += superscript[int(digit)] + term += power + + terms.append(term) + +print(' + '.join(terms)) \ No newline at end of file diff --git a/languages/python/calculators/Karatsuba Algorithm.md b/languages/python/calculators/Karatsuba Algorithm.md deleted file mode 100644 index 91cee63..0000000 --- a/languages/python/calculators/Karatsuba Algorithm.md +++ /dev/null @@ -1,28 +0,0 @@ -### Useful Links - -- [Wikipedia](https://en.wikipedia.org/wiki/Karatsuba_algorithm) -- [An amazing video on the topic](https://youtu.be/cCKOl5li6YM) - -### The Pseudocode - -``` -function karatsuba (num1, num2) - if (num1 < 10) or (num2 < 10) - return num1 × num2 /* fall back to traditional multiplication */ - - /* Calculates the size of the numbers. */ - m = min (size_base10(num1), size_base10(num2)) - m2 = floor (m / 2) - /* m2 = ceil (m / 2) will also work */ - - /* Split the digit sequences in the middle. */ - high1, low1 = split_at (num1, m2) - high2, low2 = split_at (num2, m2) - - /* 3 recursive calls made to numbers approximately half the size. */ - z0 = karatsuba (low1, low2) - z1 = karatsuba (low1 + high1, low2 + high2) - z2 = karatsuba (high1, high2) - - return (z2 × 10 ^ (m2 × 2)) + ((z1 - z2 - z0) × 10 ^ m2) + z0 -``` diff --git a/languages/python/calculators/Quadratic nth Term.py b/languages/python/calculators/Quadratic nth Term.py deleted file mode 100644 index a8d870b..0000000 --- a/languages/python/calculators/Quadratic nth Term.py +++ /dev/null @@ -1,27 +0,0 @@ -import operator -from _helpers import listInput - -def diff(a): - return list(map(operator.sub, a[1:], a[:-1])) - -def formatNumber(x): - if x % 1 == 0: - return int(x) - else: - return x - -sequence = listInput('Please input a sequence of numbers') -row1 = diff(sequence) -row2 = diff(row1) - -a = formatNumber(row2[0] / 2) -b = formatNumber(row1[0] - (3 * a)) -c = formatNumber(sequence[0] - a - b) - -print(''' -a = {0} -b = {2} -c = {4} - -Equation: {0}n²{1}{2}n{3}{4} -'''.format(a, '+' if b >= 0 else '', b, '+' if c >= 0 else '', c)) diff --git a/languages/python/calculators/STDEV.py b/languages/python/calculators/STDEV.py deleted file mode 100644 index 2f8859b..0000000 --- a/languages/python/calculators/STDEV.py +++ /dev/null @@ -1,16 +0,0 @@ -import math -from _helpers import listInput - -def sd(x): - n = len(x) - mean = sum(x) / n - squared = [y ** 2 for y in x] - - return math.sqrt(abs((sum(squared) / n) - (mean**2))) - -nums = listInput('Please input a list of numbers') -res = sd(nums) - -print() -print('The list:', nums) -print('Standard Deviation:', res) diff --git a/languages/python/calculators/readme.md b/languages/python/calculators/readme.md index f644b30..1f7b393 100644 --- a/languages/python/calculators/readme.md +++ b/languages/python/calculators/readme.md @@ -1,15 +1,22 @@ -# calculators +
-Some extra information on the more complex topics (: +### Babylonian Square Root -## Karatsuba Algorithm + -### Useful Links +#### LaTeX -- [Wikipedia](https://en.wikipedia.org/wiki/Karatsuba_algorithm) -- [An amazing video on the topic](https://youtu.be/cCKOl5li6YM) +``` +x_0 \approx \sqrt{S} \\ +x_{n + 1} = \frac{x_n + \frac{S}{x_n}}{2} \\ +\sqrt{S} = \displaystyle \lim_{n \to \infty}x_n +``` -### The Pseudocode +### Karatsuba Algorithm + +[Wikipedia](https://en.wikipedia.org/wiki/Karatsuba_algorithm) + +[An amazing video on the topic](https://youtu.be/cCKOl5li6YM) ``` function karatsuba (num1, num2) @@ -32,3 +39,5 @@ function karatsuba (num1, num2) return (z2 × 10 ^ (m2 × 2)) + ((z1 - z2 - z0) × 10 ^ m2) + z0 ``` + +
diff --git a/languages/python/pp.py b/languages/python/pp.py deleted file mode 100644 index 14ad535..0000000 --- a/languages/python/pp.py +++ /dev/null @@ -1,45 +0,0 @@ -import oppaipy -import requests -import os - -# Request information about the beatmap -id = input('Please enter a beatmap ID: ').strip() -beatmap = requests.get('https://osu.ppy.sh/osu/{0}'.format(id)) # Fetch the osu file -open('{0}.osu'.format(id), 'w').write(beatmap.text.replace('\n', '')) # Write this difficulty to the disk -lines = open('{0}.osu'.format(id), 'r').readlines() # Read the lines of the osu file -artist = [x[7:len(x)].strip() for x in lines if x.startswith('Artist:')][0] # Figure out the artist of the song -name = [x[6:len(x)].strip() for x in lines if x.startswith('Title:')][0] # Figure out the name of the song -diff = [x[8:len(x)].strip() for x in lines if x.startswith('Version:')][0] # Figure out the difficulty name -name = '{0} - {1} [{2}]'.format(artist, name, diff) # Put these three together into a parseable format by osu - -# Calculate beatmap stats -calc = oppaipy.Calculator() # Create an instance of the pp calculator -calc.set_beatmap('{0}.osu'.format(id)) # Load the newly written difficulty file -calc.calculate() # Calculate the stats -calc.close() # Close the calculator to save resources - -# Round beatmap stats to be readable -stars = { - 'total': round(calc.stars, 2), - 'aim': round(calc.aim_stars, 2), - 'speed': round(calc.speed_stars, 2) -} - -pp = { - 'total': round(calc.pp, 2), - 'aim': round(calc.aim_pp, 2), - 'speed': round(calc.speed_pp, 2), - 'acc': round(calc.acc_pp, 2) -} - -# Output information -print(""" -{0} ({1}*) - -{2}* Aim -{3}* Speed -{4}pp ({5} aim pp, {6} speed pp, {7} acc pp) -""".format(name, stars['total'], stars['aim'], stars['speed'], pp['total'], pp['aim'], pp['speed'], pp['acc'])) - -# Cleanup by deleting the written difficulty file afterwards -os.remove('{0}.osu'.format(id)) diff --git a/languages/python/readme.md b/languages/python/readme.md index bae08e6..e1b38bf 100644 --- a/languages/python/readme.md +++ b/languages/python/readme.md @@ -15,16 +15,16 @@ ### Calculators - [Binomial Distribution](calculators/Binomial%20Distribution.py) +- [Binomial Expansion](calculators/Binomial%20Expansion.py) - [Karatsuba Algorithm](calculators/Karatsuba%20Algorithm.py) - [Pearson's Product-Moment Correlation Coefficient](calculators/PMCC.py) -- [Quadratic nth Term](calculators/Quadratic%20nth%20Term.py) -- [Square Root](calculators/SQRT.py) +- [Babylonian Square Root](calculators/Babylonian%20%Sqaure%20Root.py) - [Spearman's Rank Correlation Coefficient](calculators/SRCC.py) -- [Standard Deviation](calculators/STDEV.py) +- [Trigometric Functions](calculators/Trigometric%20Functions.py) +- [Pascal's Triangle](calculators/Pascal's%20Triangle.py) ### Other -- [PP Calculator](pp.py) - [2 Stars List](gd-two-star-list) - [Pong (made with Pygame)](pong) - [pythonchallenge.com](pythonchallenge.com) diff --git a/readme.md b/readme.md index e1364d4..4609383 100644 --- a/readme.md +++ b/readme.md @@ -8,8 +8,6 @@ ### Table of contents - [Python](languages/python) -- [C](languages/c) -- [Java](languages/java) - [Project Euler](challenges/euler) - [r/dailyprogrammer](challenges/daily-programmer) - [GCSE Computer Science](school/gcse) diff --git a/school/gcse/year 10/oop dice/OOP Dice V2.py b/school/gcse/year 10/OOP Dice.py similarity index 100% rename from school/gcse/year 10/oop dice/OOP Dice V2.py rename to school/gcse/year 10/OOP Dice.py diff --git a/school/gcse/year 10/Pallindrome Checker.py b/school/gcse/year 10/Pallindrome Checker.py new file mode 100644 index 0000000..b77e509 --- /dev/null +++ b/school/gcse/year 10/Pallindrome Checker.py @@ -0,0 +1,22 @@ +import re + +word = input('Please enter a word!') + +def isPallindrome(word): + # Strip the word of punctuation + word = re.sub(r'[^\w\s]', '', word) + + # Check if the word is a pallindrome + reverse = '' + i = len(word) + + while i > 0: + reverse += word[i - 1] + i = i - 1 + + return word == reverse + +if isPallindrome(word): + print('{0} is a pallindrome!'.format(re.sub(r'[^\w\s]', '', word))) +else: + print('{0} is not a pallindrome!'.format(re.sub(r'[^\w\s]', '', word))) diff --git a/school/gcse/year 10/oop dice/OOP Dice.py b/school/gcse/year 10/oop dice/OOP Dice.py deleted file mode 100644 index f932159..0000000 --- a/school/gcse/year 10/oop dice/OOP Dice.py +++ /dev/null @@ -1,47 +0,0 @@ -from random import randint - -class Dice: - # Initialise the class - make the default amount of sides 6 - def __init__(self, sides=6): - self.sides = sides - - # Roll the dice once - return an integer - def roll(self): - return randint(1, self.sides) - - # Roll the dice a specified amount of times - return an array of integers - def rollMany(self, times): - res = [] - for i in range(times): - num = self.roll() - res.append(num) - return res - -dice = Dice() # Create an instance of the class Dice - -p1 = dice.rollMany(6) # Roll 6 dice for player 1 -p2 = dice.rollMany(6) # Roll 6 dice for player 2 -p1score = sum(p1) # Calculate player 1's score -p2score = sum(p2) # Calculate player 2's score - -# Output player 1's rolls and score for the user to see -print("Player 1 rolls ({0})".format(p1score)) - -for i in p1: - pos = p1.index(i) + 1 - print("{0}. {1}".format(pos, i)) - -# Output player 2's rolls and score for the user to see -print("\nPlayer 2 rolls ({0})".format(p2score)) - -for i in p2: - pos = p2.index(i) + 1 - print("{0}. {1}".format(pos, i)) - -# Determine the winner -if p1score > p2score: - print("\nPlayer 1 ({0}) wins by {1} points!".format(p1score, p1score - p2score)) -elif p2score > p1score: - print("\nPlayer 2 ({0}) wins by {1} points!".format(p2score, p2score - p1score)) -else: - print("\nDraw!") \ No newline at end of file diff --git a/school/gcse/year 10/pallindromes/Pallindrome Checker with Loop.py b/school/gcse/year 10/pallindromes/Pallindrome Checker with Loop.py deleted file mode 100644 index f3e5529..0000000 --- a/school/gcse/year 10/pallindromes/Pallindrome Checker with Loop.py +++ /dev/null @@ -1,14 +0,0 @@ -word = input('Please enter a word!') - -def isPallindrome(x): - reverse = '' - i = len(x) - while i > 0: - reverse += x[i - 1] - i = i - 1 - return x == reverse - -if isPallindrome(word): - print('{0} is a pallindrome!'.format(word)) -else: - print('{0} is not a pallindrome!'.format(word)) \ No newline at end of file diff --git a/school/gcse/year 10/pallindromes/Pallindrome Checker with Punctuation Stripper.py b/school/gcse/year 10/pallindromes/Pallindrome Checker with Punctuation Stripper.py deleted file mode 100644 index d6daa67..0000000 --- a/school/gcse/year 10/pallindromes/Pallindrome Checker with Punctuation Stripper.py +++ /dev/null @@ -1,15 +0,0 @@ -word = input('Please enter a word!') -punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~''' -nopunc = '' - -for i in word: - if i not in punctuations: - nopunc = nopunc + i - -def isPallindrome(x): - return x == x[::-1] - -if isPallindrome(nopunc): - print('{0} is a pallindrome!'.format(word)) -else: - print('{0} is not a pallindrome!'.format(word)) \ No newline at end of file diff --git a/school/gcse/year 10/pallindromes/Pallindrome Checker.py b/school/gcse/year 10/pallindromes/Pallindrome Checker.py deleted file mode 100644 index 38573e0..0000000 --- a/school/gcse/year 10/pallindromes/Pallindrome Checker.py +++ /dev/null @@ -1,9 +0,0 @@ -word = input('Please enter a word!') - -def isPallindrome(x): - return x == x[::-1] - -if isPallindrome(word): - print('{0} is a pallindrome!'.format(word)) -else: - print('{0} is not a pallindrome!'.format(word)) \ No newline at end of file diff --git a/school/gcse/year 10/readme.md b/school/gcse/year 10/readme.md deleted file mode 100644 index 6fe1a1d..0000000 --- a/school/gcse/year 10/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -
-

year 10

-
- -- [Calculator](calculator) -- [Cat or Dog](cat%20or%20dog) -- [Mark Analyser](mark%20analyser) -- [OOP Dice](oop%20dice) -- [Pallindromes](pallindromes) -- [Password Reset](password%20reset) -- [Raspberry Pie Game](raspberry%20pie%20game) -- [API Hangman](API%20Hangman.py) -- [Temperature Bar Chart](Temperature%20Bar%20Chart.py) diff --git a/school/gcse/year 11/8 Ball.py b/school/gcse/year 11/8 Ball.py new file mode 100644 index 0000000..48d3377 --- /dev/null +++ b/school/gcse/year 11/8 Ball.py @@ -0,0 +1,15 @@ +import random + +class EightBall: + def __init__(self): + self.responses = ['It is certain.','It is decidedly so.','Without a doubt.','Yes — definitely.','You may rely on it.','As I see it, yes.','Most likely.','Outlook good.','Yes.','Signs point to yes.','Reply hazy, try again.','Ask again later.','Better not tell you now.','Cannot predict now.','Concentrate and ask again.','Don’t count on it.','My reply is no.','My sources say no.','Outlook not so good.','Very doubtful.'] + def answer(self): + return random.choice(self.responses) + +ball = EightBall() +question = input('What is your question for the magic 8 ball?') + +print(""" +Q: %s +A: %s +""" % (question, ball.answer())) \ No newline at end of file diff --git a/school/gcse/year 11/Bubble Sort.py b/school/gcse/year 11/Bubble Sort.py new file mode 100644 index 0000000..b14d121 --- /dev/null +++ b/school/gcse/year 11/Bubble Sort.py @@ -0,0 +1,32 @@ +import random + +def generateList(minimum, maximum, length): + res = [] + for i in range(length): + res.append(random.randint(minimum, maximum)) + return res + +def bubbleSort(data, asc = True): + dataClone = data.copy() + hasSwapped = True + indexToCheck = len(dataClone) - 1 + while indexToCheck > 0 and hasSwapped: + hasSwapped = False + for i in range(indexToCheck): + if asc and dataClone[i] > dataClone[i + 1] or not asc and dataClone[i] < dataClone[i + 1]: + hasSwapped = True + a, b = dataClone[i], dataClone[i + 1] + dataClone[i] = b + dataClone[i + 1] = a + indexToCheck -= 1 + return dataClone + +nums = generateList(0, 100, 15) +sortedAsc = bubbleSort(nums, True) +sortedDesc = bubbleSort(nums, False) + +print(""" +Original: %s +Ascending: %s +Descending: %s +""" % (str(nums), str(sortedAsc), str(sortedDesc))) \ No newline at end of file diff --git a/school/gcse/year 11/Card Shuffler.py b/school/gcse/year 11/Card Shuffler.py new file mode 100644 index 0000000..9d8a4c0 --- /dev/null +++ b/school/gcse/year 11/Card Shuffler.py @@ -0,0 +1,43 @@ +import random + +class Deck(): + def __init__(self, suits): + self.cards = [] + self.suits = suits + + def generate(self): + for suit in self.suits: + for cardType in range(1, 14): + formattedCard = "" + + if cardType == 1: + formattedCard += "Ace" + elif cardType == 11: + formattedCard += "Jack" + elif cardType == 12: + formattedCard += "Queen" + elif cardType == 13: + formattedCard += 'King' + else: + formattedCard += str(cardType) + + formattedCard += ' of %s' % (suit) + self.cards.append(formattedCard) + + def shuffle(self): + currentCards = self.cards + shuffledCards = [] + + while len(currentCards) > 0: + pick = random.randint(0, len(currentCards) - 1) + removedCard = currentCards.pop(pick) + shuffledCards.append(removedCard) + + self.cards = shuffledCards + +deck = Deck(["Spades", "Hearts", "Diamonds", "Clubs"]) +print(deck.cards) +deck.generate() +print(deck.cards) +deck.shuffle() +print(deck.cards) \ No newline at end of file diff --git a/school/gcse/year 11/File Size Estimates.py b/school/gcse/year 11/File Size Estimates.py new file mode 100644 index 0000000..c801666 --- /dev/null +++ b/school/gcse/year 11/File Size Estimates.py @@ -0,0 +1,115 @@ +import math +import uuid +from datetime import datetime + +class NegativeError(Exception): + pass + +def estimateTextFileSize(characterCount, bitsPerCharacter): + return characterCount * bitsPerCharacter + +def estimatePictureFileSize(width, height, colourDepth): + return colourDepth * width * height + +def estimateSoundFileSize(sampleRate, bitDepth, duration, channelCount): + return sampleRate * duration * bitDepth * channelCount + +def formatBits(bits): + units = ['bits', 'bytes', 'kilobytes', 'megabytes', 'gigabytes', 'terrabytes', 'petabytes'] + + for unit in units: + if unit == units[0]: + bits /= 8 + elif bits < 1024 or unit == units[len(units) - 1]: + break + else: + bits /= 1024 + + return '%i %s' % (math.floor(bits), unit) + +def validateInput(function, inputMessage, errorMessage): + while True: + try: + out = function(input(inputMessage)) + + if (function == int or function == float) and out < 0: + raise NegativeError + + break + except ValueError: + print(errorMessage) + continue + except NegativeError: + print('The value you input can not be a negative number! Please try again (:') + continue + return out + +def saveFile(data, fileType, bits): + while True: + toSave = input('Would you like to save your file? y/n').lower() + + if toSave == 'y': + id = uuid.uuid1() + file = open('%s.txt' % (id), 'w') + file.write('Date: %s\n' % (datetime.now().strftime('%d/%m/%Y, %I:%M %p'))) + file.write('ID: %s\n' % (id)) + + for set in data: + key = set[0] + value = set[1] + file.write('%s: %s\n' % (key, value)) + + file.write('---------------------------------------------\n\n') + file.write('Your %s file\'s size is approximately %s' % (fileType, formatBits(bits))) + break + +# Menu +while True: + print("""Welcome to the File Size Estimator! Please choose a function below: + +1) Estimate Text File Size +2) Estimate Picture File Size +3) Estimate Sound File Size +""") + + choice = validateInput(int, 'Please make your choice: ', 'Please make sure you select a valid function!') + + if choice == 1: + characterCount = validateInput(int, 'How many characters are in your text file? ', 'Please make sure you enter a valid integer!') + bitsPerCharacter = validateInput(int, 'How many bits are used to store a character in your text file? ', 'Please make sure you enter a valid integer!') + bits = estimateTextFileSize(characterCount, bitsPerCharacter) + + print('Your text file\'s size is approximately %s' % (formatBits(bits))) + saveFile([['Character Count', characterCount], ['Bits Per Character', bitsPerCharacter]], 'text', bits) + elif choice == 2: + width = validateInput(float, 'What is the width of your image? ', 'Please make sure you enter a valid number!') + height = validateInput(float, 'What is the height of your image? ', 'Please make sure you enter a valid number!') + colourDepth = validateInput(int, 'What is the colour depth of your image? ', 'Please make sure you enter a valid integer!') + bits = estimatePictureFileSize(width, height, colourDepth) + + print('Your image file\'s size is approximately %s' % (formatBits(bits))) + saveFile([['Image Width', width], ['Image Height', height], ['Colour Depth', colourDepth]], 'image', bits) + elif choice == 3: + sampleRate = validateInput(int, 'What is the sample rate of your audio file? ', 'Please make sure you enter a valid integer!') + bitDepth = validateInput(int, 'What is the bit depth of your audio file? ', 'Please make sure you enter a valid integer!') + duration = validateInput(float, 'What is the duration of your audio file in seconds? ', 'Please make sure you enter a valid number!') + channelCount = validateInput(int, 'How many channels does your audio file have? ', 'Please make sure you enter a valid integer!') + bits = estimateSoundFileSize(sampleRate, bitDepth, duration, channelCount) + + print('Your audio file\'s size is approximately %s' % (formatBits(bits))) + saveFile([['Sample Rate', sampleRate], ['Bit Depth', bitDepth], ['Duration', duration], ['Channel Count', channelCount]], 'text', bits) + else: + continue + + while True: + again = input('Would you like to go again? y/n').lower() + + if again != 'y' and again != 'n': + continue + else: + break + + if choice == 'y': + continue + else: + break \ No newline at end of file diff --git a/school/gcse/year 11/If Statement Program Challenge.py b/school/gcse/year 11/If Statement Program Challenge.py new file mode 100644 index 0000000..7c69d74 --- /dev/null +++ b/school/gcse/year 11/If Statement Program Challenge.py @@ -0,0 +1,74 @@ +import random +import time + +# A class to represent a fair n-sided dice +class Dice: + def __init__(self, sides): + self.sides = sides + + def roll(self): + return random.randint(1, self.sides) + +# A class to represent the player +class Player: + def __init__(self): + self.dice = Dice(6) + self.score = 0 + + def roll(self): + return self.dice.roll() + +# Enum to represent the result of the end of the game +### 0 - Tie +### 1 - Player One wins! +### 2 - Player Two wins! +class GameResult: + Tie = 0 + PlayerOne = 1 + PlayerTwo = 2 + +# Initialise key variables for the game +playerOne = Player() +playerTwo = Player() +currentRound = 0 + +# Play a round of the game +def play(): + global currentRound + + # Increment the round and roll the dice + currentRound += 1 + playerOneRoll = playerOne.roll() + playerTwoRoll = playerTwo.roll() + + # Figure out the result of the game + if playerOneRoll > playerTwoRoll: + playerOne.score += 1 + state = GameResult.PlayerOne + elif playerOneRoll == playerTwoRoll: + state = GameResult.Tie + else: + playerTwo.score += 1 + state = GameResult.PlayerTwo + + # Turn the result of the game into a string + if state == GameResult.Tie: + header = 'Round %i was a tie' % (currentRound) + elif state == GameResult.PlayerOne: + header = 'Player One wins Round %i' % (currentRound) + elif state == GameResult.PlayerTwo: + header = 'Player Two wins Round %i' % (currentRound) + + # Print a summary of the end of the round + print(""" + +%s! The current scores are as follows: + +Player One - %i +Player Two - %i""" % (header, playerOne.score, playerTwo.score) + ) + +# Keep playing until someone has won three rounds +while playerOne.score != 3 and playerTwo.score != 3: + play() # Play the round + time.sleep(2) # Pause for two seconds to allow for time for the user to read the summary \ No newline at end of file diff --git a/school/gcse/year 11/League Table.py b/school/gcse/year 11/League Table.py new file mode 100644 index 0000000..4f320f6 --- /dev/null +++ b/school/gcse/year 11/League Table.py @@ -0,0 +1,88 @@ +import csv +import os + +path = '%s\league-table.csv' % (os.getcwd()) + +def clear(): + print('\n' * 50) + +def resolveDataType(data): + result = data + try: + result = int(data) + except ValueError: + try: + result = float(data) + except ValueError: + temp = list(data) + if len(temp) > 0: + i = 0 + for value in temp: + temp[i] = resolveDataType(value) + i += 1 + if len(temp) > 1: + result = temp + return result + +def ensureFileExists(): + doesExist = os.path.isfile(path) + + if not doesExist: + with open(path, 'w') as file: + writer = csv.writer(file) + writer.writerow(['Name', 'Games Played', 'Games Won', 'Games Lost', 'Games Drawn', 'Overall Points', 'GD']) + file.close() + +def readTeams(): + with open(path, 'r') as file: + reader = csv.reader(file) + headers = next(reader) # get the headers and remove them from the reader + + for row in reader: + col = 0 + for value in row: + print('%s: %s' % (headers[col], value)) + col += 1 + + file.close() + +def writeTeam(): + with open(path, 'r+') as file: + reader = csv.reader(file) + headers = next(reader) + data = [] + + for header in headers: + response = input('%s?' % (header)) + data.append(response) + + writer = csv.writer(file) + writer.writerow(data) + file.close() + +# Menu +def displayMenu(): + print("""Welcome to the League Table! What would you like to do? + +1) View the current state of the League Table +2) Write to the League Table +3) Remove from the League Table""") + + while True: + try: + menuOption = int(input('Which option would you like to select? ')) + break + except ValueError: + print('Please make sure that your input is a valid integer!') + continue + + if menuOption == 1: + clear() + readTeams() + elif menuOption == 2: + clear() + writeTeam() + +##ensureFileExists() +##displayMenu() +print(resolveDataType('[1,2,3]')) \ No newline at end of file diff --git a/school/gcse/year 11/Linear Search.py b/school/gcse/year 11/Linear Search.py new file mode 100644 index 0000000..571df52 --- /dev/null +++ b/school/gcse/year 11/Linear Search.py @@ -0,0 +1,43 @@ +def linearSearch(data, value): + for i in range(0, len(data)): + if data[i] == value: + return i + return -1 + +class ConfirmationError(Exception): + pass + +numbers = [] +addingStage = True + +while addingStage: + try: + number = float(input('Please enter a number to add to the list')) + numbers.append(number) + while True: + try: + toContinue = input('Would you like to enter another number? (y/n)') + if toContinue == 'y': + break + if toContinue == 'n': + addingStage = False + break + else: + raise ConfirmationError + except ConfirmationError: + print('Please make sure you enter a valid confirmation value!') + except ValueError: + print('Please make sure you enter a valid number!') + +while True: + try: + toSearch = float(input('Please enter a number to find the index of')) + index = linearSearch(numbers, toSearch) + print(numbers) + if index == -1: + print('%.2f is not in the list' % (toSearch)) + else: + print('%.2f is at index %i in the list' % (toSearch, index)) + break + except ValueError: + print('Please make sure you enter a valid number!') \ No newline at end of file diff --git a/school/gcse/year 11/Maths Quiz.py b/school/gcse/year 11/Maths Quiz.py index 3156946..1bf5a19 100644 --- a/school/gcse/year 11/Maths Quiz.py +++ b/school/gcse/year 11/Maths Quiz.py @@ -1,101 +1,101 @@ -import random -import operator -import os - -# Constants -ANSWER_COUNT = 4 - -ops = { - '+': operator.add, - '-': operator.sub, - '*': operator.mul, - '/': operator.truediv -} - -score = 0 - -'''Clears the console.''' -def cls(): - os.system('cls' if os.name == 'nt' else 'clear') - -'''Formats a number.''' -def formatNumber(num): - if num % 1 == 0: - return str(int(num)) - else: - return '%.2f' % num - -'''Generates a question to be used''' -def generateQuestion(): - while True: - x = random.randint(0, 11) - y = random.randint(1, 11) - op = random.choice(list(ops.keys())) - if op == '/' and y > x: - continue - else: - answer = ops.get(op)(x, y) - return (x, y, op, answer) - -'''Generates a fake answer based on the real answer.''' -def generateFakeAnswer(answer): - r = random.randint(-10, 10) - return answer + r - -'''Asks a question.''' -def askQuestion(): - global score - x, y, op, answer = generateQuestion() - - # Generate a list of potential fake answers - answerList = {} - answerLocation = random.randint(1, ANSWER_COUNT) - - for i in range(1, 5): - if i == answerLocation: - answerList[i] = answer - else: - while True: - generated = generateFakeAnswer(answer) - if generated != answer: - answerList[i] = generated - break - - # Format that list of potential fake answers into a string - answers = '' - - for key in answerList: - value = answerList.get(key) - answers += '\n%i) %s' % (key, formatNumber(value)) - - # Ask the question - print(""" -What is the correct answer to the following expression? %i %s %i -%s - """ % (x, op, y, answers)) - - # Recieve input and mark the user based on it - while True: - try: - userAnswer = float(input('Which is the correct answer? ')) - if userAnswer == answerLocation: - print('You got it right!') - score = score + 1 - else: - print('You got it wrong!') - break - except ValueError: - print('Your input must be a number!') - -# Ask the user how many questions they would like to be asked -while True: - try: - howMany = int(input('How many questions would you like to answer? ')) - cls() - for i in range(howMany): - askQuestion() - cls() - print('Your final score is %i/%i!' % (score, howMany)) - break - except ValueError: - print('Your input must be a number!') +import random +import operator +import os + +# Constants +ANSWER_COUNT = 4 + +ops = { + '+': operator.add, + '-': operator.sub, + '*': operator.mul, + '/': operator.truediv +} + +score = 0 + +'''Clears the console.''' +def cls(): + os.system('cls' if os.name == 'nt' else 'clear') + +'''Formats a number.''' +def formatNumber(num): + if num % 1 == 0: + return str(int(num)) + else: + return '%.2f' % num + +'''Generates a question to be used''' +def generateQuestion(): + while True: + x = random.randint(0, 11) + y = random.randint(1, 11) + op = random.choice(list(ops.keys())) + if op == '/' and y > x: + continue + else: + answer = ops.get(op)(x, y) + return (x, y, op, answer) + +'''Generates a fake answer based on the real answer.''' +def generateFakeAnswer(answer): + r = random.randint(-11, 11) + return answer + r + +'''Asks a question.''' +def askQuestion(): + global score + x, y, op, answer = generateQuestion() + + # Generate a list of potential fake answers + answerList = {} + answerLocation = random.randint(1, ANSWER_COUNT) + + for i in range(1, 5): + if i == answerLocation: + answerList[i] = answer + else: + while True: + generated = generateFakeAnswer(answer) + if generated != answer and generated not in answerList: + answerList[i] = generated + break + + # Format that list of potential fake answers into a string + answers = '' + + for key in answerList: + value = answerList.get(key) + answers += '\n%i) %s' % (key, formatNumber(value)) + + # Ask the question + print(""" +What is the correct answer to the following expression? %i %s %i +%s + """ % (x, op, y, answers)) + + # Recieve input and mark the user based on it + while True: + try: + userAnswer = float(input('Which is the correct answer? ')) + if userAnswer == answerLocation: + print('You got it right!') + score = score + 1 + else: + print('You got it wrong!') + break + except ValueError: + print('Your input must be a number!') + +# Ask the user how many questions they would like to be asked +while True: + try: + howMany = int(input('How many questions would you like to answer? ')) + cls() + for i in range(howMany): + askQuestion() + cls() + print('Your final score is %i/%i!' % (score, howMany)) + break + except ValueError: + print('Your input must be a number!') diff --git a/school/gcse/year 11/Turtle n-gon.py b/school/gcse/year 11/Turtle n-gon.py new file mode 100644 index 0000000..080e7c4 --- /dev/null +++ b/school/gcse/year 11/Turtle n-gon.py @@ -0,0 +1,52 @@ +from turtle import Turtle, Screen, numinput, textinput +from random import random + +def generateColour(): + return (random(), random(), random()) + +# Configure the turtle +turtle = Turtle() + +while True: + # Change the colour of the turtle + r, g, b = generateColour() + turtle.color(r, g, b) + + # Collect the amount of sides + while True: + try: + sides = int(numinput('Side Count', 'How many sides would you like to render?')) + + if sides < 3: + raise ValueError + else: + break + except ValueError: + print('A polygon must have a minimum of 3 sides! Try again with a number >= 3') + continue + + # Move the turtle + for i in range(sides): + turtle.forward(100) + turtle.left(360 / sides) + + # Ask if the user would like to go again + while True: + try: + again = textinput('Continue?', 'Would you like to run the program again?').lower() + + if not again == 'yes' and not again == 'no' and not again == 'y' and not again == 'n': + raise ValueError + else: + break + except ValueError: + print('You must answer yes or no to this question') + continue + + if again == 'y' or again == 'yes': + # Reset the turtle and ask again + turtle.reset() + else: + # Close the turtle + Screen().bye() + break \ No newline at end of file diff --git a/school/gcse/year 9/eco fest/Asset Table.doc b/school/gcse/year 9/eco fest/Asset Table.doc deleted file mode 100644 index 63f82e5..0000000 Binary files a/school/gcse/year 9/eco fest/Asset Table.doc and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Assignment.docx b/school/gcse/year 9/eco fest/Assignment.docx deleted file mode 100644 index f06a6f0..0000000 Binary files a/school/gcse/year 9/eco fest/Assignment.docx and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Client Requirement Questions.docx b/school/gcse/year 9/eco fest/Client Requirement Questions.docx deleted file mode 100644 index d2b38f9..0000000 Binary files a/school/gcse/year 9/eco fest/Client Requirement Questions.docx and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Client Requirements.pptx b/school/gcse/year 9/eco fest/Client Requirements.pptx deleted file mode 100644 index f9aeb9c..0000000 Binary files a/school/gcse/year 9/eco fest/Client Requirements.pptx and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Eco Fest.pptx b/school/gcse/year 9/eco fest/Eco Fest.pptx deleted file mode 100644 index 52705c1..0000000 Binary files a/school/gcse/year 9/eco fest/Eco Fest.pptx and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Legal Restrictions.docx b/school/gcse/year 9/eco fest/Legal Restrictions.docx deleted file mode 100644 index cd1e284..0000000 Binary files a/school/gcse/year 9/eco fest/Legal Restrictions.docx and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Review.docx b/school/gcse/year 9/eco fest/Review.docx deleted file mode 100644 index 1193566..0000000 Binary files a/school/gcse/year 9/eco fest/Review.docx and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Site Map.png b/school/gcse/year 9/eco fest/Site Map.png deleted file mode 100644 index cb2a34c..0000000 Binary files a/school/gcse/year 9/eco fest/Site Map.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Test Table.doc b/school/gcse/year 9/eco fest/Test Table.doc deleted file mode 100644 index fda2c43..0000000 Binary files a/school/gcse/year 9/eco fest/Test Table.doc and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Visualisation/Acts.png b/school/gcse/year 9/eco fest/Visualisation/Acts.png deleted file mode 100644 index bc3e032..0000000 Binary files a/school/gcse/year 9/eco fest/Visualisation/Acts.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Visualisation/Contact Us.png b/school/gcse/year 9/eco fest/Visualisation/Contact Us.png deleted file mode 100644 index 048df37..0000000 Binary files a/school/gcse/year 9/eco fest/Visualisation/Contact Us.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Visualisation/Environment.png b/school/gcse/year 9/eco fest/Visualisation/Environment.png deleted file mode 100644 index df968b3..0000000 Binary files a/school/gcse/year 9/eco fest/Visualisation/Environment.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Visualisation/Home.png b/school/gcse/year 9/eco fest/Visualisation/Home.png deleted file mode 100644 index dd6ffdc..0000000 Binary files a/school/gcse/year 9/eco fest/Visualisation/Home.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Visualisation/Tickets.png b/school/gcse/year 9/eco fest/Visualisation/Tickets.png deleted file mode 100644 index be9e02d..0000000 Binary files a/school/gcse/year 9/eco fest/Visualisation/Tickets.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Website/acts.html b/school/gcse/year 9/eco fest/Website/acts.html deleted file mode 100644 index 65c5365..0000000 --- a/school/gcse/year 9/eco fest/Website/acts.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - Ecofest - - - - -

Our Acts

- -
-
- Everyone's Environment -

Everyone's Environment

-
-
- Solar Drum -

Solar Drum

-
-
- Green Gizmos -

Green Gizmos

-
-
- DJ John Alfred -

DJ John Alfred

-
-
- - \ No newline at end of file diff --git a/school/gcse/year 9/eco fest/Website/assets/img/arrow.png b/school/gcse/year 9/eco fest/Website/assets/img/arrow.png deleted file mode 100644 index 2190182..0000000 Binary files a/school/gcse/year 9/eco fest/Website/assets/img/arrow.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Website/assets/img/bg.png b/school/gcse/year 9/eco fest/Website/assets/img/bg.png deleted file mode 100644 index 01af154..0000000 Binary files a/school/gcse/year 9/eco fest/Website/assets/img/bg.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Website/assets/img/everyones-environment.jpg b/school/gcse/year 9/eco fest/Website/assets/img/everyones-environment.jpg deleted file mode 100644 index db4120c..0000000 Binary files a/school/gcse/year 9/eco fest/Website/assets/img/everyones-environment.jpg and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Website/assets/img/favicon.png b/school/gcse/year 9/eco fest/Website/assets/img/favicon.png deleted file mode 100644 index ec76692..0000000 Binary files a/school/gcse/year 9/eco fest/Website/assets/img/favicon.png and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Website/assets/img/green-gizmos.jpg b/school/gcse/year 9/eco fest/Website/assets/img/green-gizmos.jpg deleted file mode 100644 index aa77c97..0000000 Binary files a/school/gcse/year 9/eco fest/Website/assets/img/green-gizmos.jpg and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Website/assets/img/john-alfred.jpg b/school/gcse/year 9/eco fest/Website/assets/img/john-alfred.jpg deleted file mode 100644 index 07218c4..0000000 Binary files a/school/gcse/year 9/eco fest/Website/assets/img/john-alfred.jpg and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Website/assets/img/solar-drum.jpg b/school/gcse/year 9/eco fest/Website/assets/img/solar-drum.jpg deleted file mode 100644 index 9e654ee..0000000 Binary files a/school/gcse/year 9/eco fest/Website/assets/img/solar-drum.jpg and /dev/null differ diff --git a/school/gcse/year 9/eco fest/Website/index.html b/school/gcse/year 9/eco fest/Website/index.html deleted file mode 100644 index 85cc573..0000000 --- a/school/gcse/year 9/eco fest/Website/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - Ecofest - - -

Ecofest

- -
- Ecofest is the environmentally-friendly music festival, taking place on the 4-5th April, 2020. - Find out about our acts here, get your tickets here, learn about how we're helping the environment here, and contact us here. -
- - \ No newline at end of file diff --git a/school/gcse/year 9/eco fest/Website/stylesheet.css b/school/gcse/year 9/eco fest/Website/stylesheet.css deleted file mode 100644 index a7ea4a8..0000000 --- a/school/gcse/year 9/eco fest/Website/stylesheet.css +++ /dev/null @@ -1,80 +0,0 @@ -/* Import "Bebas Neue" and "Open Sans" fonts from Google Fonts */ -@import url('https://fonts.googleapis.com/css?family=Bebas+Neue|Open+Sans&display=swap'); - -/* Simple browser reset */ -* { - margin: 0; - padding: 0; -} - -html { - /* Make the background never repeat and be centered at all times */ - background-image: url("./assets/img/bg.png"); - background-position: center center; - background-repeat: no-repeat; - background-attachment: fixed; - background-size: cover; - - /* Set a background colour to be displayed whilst the image is loading on slow connections */ - background-color: #212121; -} - -/* Base title styles */ -.title { - color: #7ed957; - font-family: 'Bebas Neue', cursive; - font-size: 132px; - margin-top: 75px; - display: inline-block; -} - -/* Home page specific styles for the title class */ -.title.home { - margin-left: 1050px; - margin-top: 325px; -} - -/* Styles for the green content box used on most pages */ -.content { - background-color: #7ed957; - color: #212121; - font-family: 'Open Sans', sans-serif; - font-size: 24px; - padding: 20px; - margin-right: 50px; -} - -/* Styling to make hyperlinks orange and bold */ -a { - color: #FF5722; - font-weight: bold; - text-decoration: none; -} - -/* Styling to underline hyperlinks when they are hovered over */ -a:hover { - text-decoration: underline -} - -/* Styling for the svg of the back button, displayed on all pages - exluding the home page */ -.back { - height: 125px; - width: auto; -} - -/* Styling that will get applied to both the back button and the title - on every page, except from the home page. */ -.back && .title && :not(.home) { - display: inline-block; -} - -/* Styling for the array of acts displayed on the acts page */ -.acts { - -} - -/* Styling for each induvidual act within the acts array */ -.act { - -} \ No newline at end of file diff --git a/school/gcse/year 9/eco fest/Workplan.docx b/school/gcse/year 9/eco fest/Workplan.docx deleted file mode 100644 index 84ced4e..0000000 Binary files a/school/gcse/year 9/eco fest/Workplan.docx and /dev/null differ diff --git a/school/gcse/year 9/eco fest/readme.md b/school/gcse/year 9/eco fest/readme.md deleted file mode 100644 index 81dd238..0000000 --- a/school/gcse/year 9/eco fest/readme.md +++ /dev/null @@ -1 +0,0 @@ -# [Hosted Version](https://ecofest.newtt.me/) diff --git a/school/gcse/year 9/pet planet/assets/css/index.css b/school/gcse/year 9/pet planet/assets/css/index.css deleted file mode 100644 index 6bbfece..0000000 --- a/school/gcse/year 9/pet planet/assets/css/index.css +++ /dev/null @@ -1,82 +0,0 @@ -@import url('https://fonts.googleapis.com/css?family=Open+Sans|Playfair+Display&display=swap'); - -* { - margin: 0; - padding: 0; -} - -html { - background-color: #000000; - color: #ffffff; - text-align: center; -} - -h1, h2 { font-family: 'Playfair Display', serif; } - -h1 { - font-size: 48px; - margin-bottom: 50px; -} - -h2 { - font-size: 36px; -} - -p { - font-family: 'Open Sans', sans-serif; - font-weight: light; - font-size: 18px; -} - -nav { - list-style-type: none; - overflow: hidden; - margin-bottom: 50px; -} - -nav li { - float: right; - font-size: 18px; - font-family: 'Open Sans', sans-serif; - margin-top: 18px; -} - -nav a { - display: block; - color: white; - text-align: center; - text-decoration: none; - padding: 14px 16px; -} - -nav :not(.left) a:hover { - background-color: #ffffff; - color: #000000; -} - -nav li.left { - float: left; - font-size: 36px; - font-family: 'Playfair Display', serif; - margin-top: 0px; -} - -div.images { margin-top: 75px; } - -div.images img { - height: 250px; - width: 250px; - margin-right: 40px; -} - -a { - color: white; - text-decoration: none; - font-family: 'Open Sans', sans-serif; - font-size: 24px; -} - -a:hover { - background-color: #ffffff; - color: #000000; -} \ No newline at end of file diff --git a/school/gcse/year 9/pet planet/assets/favicon.ico b/school/gcse/year 9/pet planet/assets/favicon.ico deleted file mode 100644 index fed7dc1..0000000 Binary files a/school/gcse/year 9/pet planet/assets/favicon.ico and /dev/null differ diff --git a/school/gcse/year 9/pet planet/assets/img/mouse_toy.jpg b/school/gcse/year 9/pet planet/assets/img/mouse_toy.jpg deleted file mode 100644 index 40f447e..0000000 Binary files a/school/gcse/year 9/pet planet/assets/img/mouse_toy.jpg and /dev/null differ diff --git a/school/gcse/year 9/pet planet/assets/img/pedigree_dogfood.jpg b/school/gcse/year 9/pet planet/assets/img/pedigree_dogfood.jpg deleted file mode 100644 index 4cb0039..0000000 Binary files a/school/gcse/year 9/pet planet/assets/img/pedigree_dogfood.jpg and /dev/null differ diff --git a/school/gcse/year 9/pet planet/assets/img/splaker_leash.jpg b/school/gcse/year 9/pet planet/assets/img/splaker_leash.jpg deleted file mode 100644 index 4dc25ca..0000000 Binary files a/school/gcse/year 9/pet planet/assets/img/splaker_leash.jpg and /dev/null differ diff --git a/school/gcse/year 9/pet planet/assets/ogp.jpg b/school/gcse/year 9/pet planet/assets/ogp.jpg deleted file mode 100644 index 8a92ceb..0000000 Binary files a/school/gcse/year 9/pet planet/assets/ogp.jpg and /dev/null differ diff --git a/school/gcse/year 9/pet planet/brief.docx b/school/gcse/year 9/pet planet/brief.docx deleted file mode 100644 index 3ddbf02..0000000 Binary files a/school/gcse/year 9/pet planet/brief.docx and /dev/null differ diff --git a/school/gcse/year 9/pet planet/care.html b/school/gcse/year 9/pet planet/care.html deleted file mode 100644 index 55f4829..0000000 --- a/school/gcse/year 9/pet planet/care.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - Pet Planet - - - - - - - - - - - - - - - - - - - -

Caring for your pets

- -

Cats

-

Some essential things you must do to care for your cat include things like getting them micro-chipped, neutering them, getting them a vet plan, keeping their vaccinations up to date, getting pet insurance, and providing plenty of playtime.

- -

Dogs

-

Some essential things you must do to care for your dog includes things like providing a clean living environment for uour dog, keeping fresh water available, giving them a quality diet, having them examined by a vet on a regular basis, provide ample opportunites to exrcise, and training them to follow simple commands.

- - diff --git a/school/gcse/year 9/pet planet/design/care.png b/school/gcse/year 9/pet planet/design/care.png deleted file mode 100644 index 713144e..0000000 Binary files a/school/gcse/year 9/pet planet/design/care.png and /dev/null differ diff --git a/school/gcse/year 9/pet planet/design/home.png b/school/gcse/year 9/pet planet/design/home.png deleted file mode 100644 index 459720b..0000000 Binary files a/school/gcse/year 9/pet planet/design/home.png and /dev/null differ diff --git a/school/gcse/year 9/pet planet/design/products.png b/school/gcse/year 9/pet planet/design/products.png deleted file mode 100644 index c3ce1d7..0000000 Binary files a/school/gcse/year 9/pet planet/design/products.png and /dev/null differ diff --git a/school/gcse/year 9/pet planet/index.html b/school/gcse/year 9/pet planet/index.html deleted file mode 100644 index 45480cd..0000000 --- a/school/gcse/year 9/pet planet/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - Pet Planet - - - - - - - - - - - - - - - - - - - -

Welcome to Pet Planet

-

We are a family-run pet shop located in Ashford Highstreet.

- -

Check us out

- - -


- Contact us. - - diff --git a/school/gcse/year 9/pet planet/products.html b/school/gcse/year 9/pet planet/products.html deleted file mode 100644 index 98fdf41..0000000 --- a/school/gcse/year 9/pet planet/products.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - Pet Planet - - - - - - - - - - - - - - - - - - -

Products

-

We stock many high quality products in our store.
Check them out here.

- -
- Pedigree Dogfood - Splaker Dog Leash - Mouse Toy -
- - diff --git a/school/gcse/year 9/pet planet/readme.md b/school/gcse/year 9/pet planet/readme.md deleted file mode 100644 index 29b5f02..0000000 --- a/school/gcse/year 9/pet planet/readme.md +++ /dev/null @@ -1 +0,0 @@ -# [Hosted Version](https://petplanet.newtt.me/) diff --git a/school/gcse/year 9/python challenges/Python_challenges - with added help.pptx b/school/gcse/year 9/python challenges/Python_challenges - with added help.pptx deleted file mode 100644 index 88cccfe..0000000 Binary files a/school/gcse/year 9/python challenges/Python_challenges - with added help.pptx and /dev/null differ diff --git a/school/gcse/year 9/python challenges/quizresult-2742639a-f275-11ea-9229-002324f58d74.txt b/school/gcse/year 9/python challenges/quizresult-2742639a-f275-11ea-9229-002324f58d74.txt deleted file mode 100644 index e7bc679..0000000 --- a/school/gcse/year 9/python challenges/quizresult-2742639a-f275-11ea-9229-002324f58d74.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name: adhas -Quiz result: 0/3 \ No newline at end of file diff --git a/school/gcse/year 9/python challenges/quizresult-bc62cd8a-f274-11ea-8f35-002324f58d74.txt b/school/gcse/year 9/python challenges/quizresult-bc62cd8a-f274-11ea-8f35-002324f58d74.txt deleted file mode 100644 index a947d58..0000000 --- a/school/gcse/year 9/python challenges/quizresult-bc62cd8a-f274-11ea-8f35-002324f58d74.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name: Sam -Quiz result: 2/3 \ No newline at end of file diff --git a/school/gcse/year 9/python challenges/quizresult-cc52ad90-f274-11ea-8144-002324f58d74.txt b/school/gcse/year 9/python challenges/quizresult-cc52ad90-f274-11ea-8144-002324f58d74.txt deleted file mode 100644 index 739e6df..0000000 --- a/school/gcse/year 9/python challenges/quizresult-cc52ad90-f274-11ea-8144-002324f58d74.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name: newt -Quiz result: 3/3 diff --git a/school/gcse/year 9/python challenges/quizresult-example.txt b/school/gcse/year 9/python challenges/quizresult-example.txt deleted file mode 100644 index 4df2826..0000000 --- a/school/gcse/year 9/python challenges/quizresult-example.txt +++ /dev/null @@ -1,2 +0,0 @@ -Name: test -Quiz result: 1/3 \ No newline at end of file diff --git a/school/gcse/year 9/python challenges/registration-example.txt b/school/gcse/year 9/python challenges/registration-example.txt deleted file mode 100644 index 72e5ee9..0000000 --- a/school/gcse/year 9/python challenges/registration-example.txt +++ /dev/null @@ -1 +0,0 @@ -Name: John DoeGender: MaleForm: 9AA1 diff --git a/school/gcse/year 9/readme.md b/school/gcse/year 9/readme.md deleted file mode 100644 index 01a752d..0000000 --- a/school/gcse/year 9/readme.md +++ /dev/null @@ -1,16 +0,0 @@ -
-

year 9

-
- -### Python - -- [Encryption](encryption) - - [Caesar Cipher Decrypter](encryption/Caesar%20Cipher%20Decrypter.py) - - [Caesar Cipher Encrypter](encryption/Caesar%20Cipher%20Encrypter.py) - - [Enkodo Cipher (own creation)](encryption/Enkodo%20Cipher.py) -- [Python Challenges](python%20challenges) - -### Web - -- [Eco Fest](eco%20fest) -- [Pet Planet](pet%20planet) diff --git a/school/royal institute/readme.md b/school/royal institute/readme.md index bcc0900..4340657 100644 --- a/school/royal institute/readme.md +++ b/school/royal institute/readme.md @@ -1,9 +1,9 @@
- +

royal institute computer science masterclass 2021

### Uploaded Lessons -- [Computer Science and Social Media](computer%20science%20and%20social%20media) -- [From Ancient Babylon to Quantum Computing](from%20ancient%20babylon%20to%20quantum%20computing) +- [Computer Science and Social Media](computer%20science%20and%20social%20media) +- [From Ancient Babylon to Quantum Computing](from%20ancient%20babylon%20to%20quantum%20computing)