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
{ | |
name: Fractions test | |
questions: [ | |
{ | |
name: Question 4 | |
variables: { | |
a: "sa*random(1..9)" | |
b: "sb*random(1..9)" | |
c: "sc*random(1..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
{ | |
name: TestA | |
extensions: [jsxgraph] | |
questions: [ | |
{ | |
name: Question 1 | |
variables: { | |
a: random(1..11) | |
g: "switch(a=1, random(2..11),a=2,random(3..11#2),a=3,random(4,5,7,8,10,11),a=4,random(5,7,9,11),a=5, random(6,7,8,9,11),a=6,random(7,11),a=7,random(8,9,10,11),a=8,random(9,11),a=9,random(10,11),a=10,11,a=11,12)" | |
b: "switch(f=2,1,f=3,random(1,2),f=4,random(1,3),f=5, random(1..4),f=6,random(1,5),f=7,random(1..6),f=8,random(1,3,5,7),f=9,random(1,2,4,5,7,8),f=10,random(1,3,7,9),f=11,random(1..10))" |
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
{ | |
name: testcom | |
questions: [ | |
{ | |
name: Complex Test | |
statement: """Express the following in the form $a+bi$ where $a$ and $b$ are real. """ | |
variables: { | |
a4: "s4*random(1..9)" | |
b4: "s1*random(1..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
{ | |
name: "Demo Exam" | |
duration: 0 | |
percentPass: 50 | |
shuffleQuestions: false | |
navigation: { | |
reverse: false | |
browse: false | |
showfrontpage: false | |
onadvance: { |
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 itertools import product | |
from operator import mul | |
from functools import reduce | |
from math import log | |
#represent the state of the board with a binary string of 9 digits | |
#the states form a group under XOR on each cell - | |
#when combining states S1 and S2, a cell is lit up iff it is lit up in S1 XOR it is lit up in S2 | |
#states commute: S1.S2 = S2.S1, because XOR commutes | |
#additionally, note that for every state S, S.S = 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
graph PHD2 { | |
ratio=0.55;fontname="Calibri";fontsize=24;label="PHD2";size="5.374,4.5";margin=0; | |
node [shape=none,fontname="Calibri",fontsize=20]; | |
"Stacey Aston"; | |
"Nathan Barker"; | |
"Matthew Buckley"; | |
"David Elliott"; | |
"Michael Garrett"; | |
"Christian Perfect"; |
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
#generate a list of primes, somewhat inefficiently | |
primes=[2] | |
for x in range(3,999,2): | |
if len([y for y in primes if y*y<=x and x % y == 0])==0: | |
primes.append(x) | |
#keep only three-digit primes | |
primes = [x for x in primes if x>100] | |
#collect primes into anagram classes |
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
/* | |
* Classic example grammar, which recognizes simple arithmetic expressions like | |
* "2*(3+4)". The parser generated from this grammar then computes their value. | |
*/ | |
start | |
= expr:expression { return expr({}); } | |
expression | |
= function |
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 Javascript, any function acts as an object constructor when you call it with the `new` keyword. | |
So, this: | |
var spring1 = new Spring(particle1, particle2, length, stiffness); | |
creates a new object which inherits all of Spring.prototype's methods and properties, and then the function Spring(..) is called on it. | |
Inside the function Spring(..), `this` refers to the newly-created object. | |
*/ |
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 itertools import product,combinations,count | |
from random import shuffle,randrange | |
from time import sleep | |
def nicelist(l): | |
if len(l)<=1: | |
return ''.join(l) | |
else: | |
return ', '.join(l[:-1])+' and '+l[-1] |
OlderNewer