Skip to content

Instantly share code, notes, and snippets.

import sys
import math
import random
import json
# How many judges need to judge each table
JUDGES_PER_TABLE = 3
# How many 'chunks' of tables a judge is assigned. Higher values will result in
# more distinct table lists but more rooms per judge
P=[4, 3, 2, 1] e=1 E=[]
Exchanging at 3 at 1/3 probability
P=[4, 3, 1, 2] e=1 E=[3]
Exchanging at 1 at 1/3 probability
P=[3, 4, 1, 2] e=1 E=[1, 3]
Exchanging at 2 at 1/3 probability
P=[3, 1, 4, 2] e=1 E=[1, 2, 3]
Exchanging at 1 at 1/5 probability
P=[1, 3, 4, 2] e=1 E=[1, 2, 3]
Choosing ascent at 1/4 probability
from random import randint, shuffle
import random
def main():
n = int(input('Permutation length n: '))
num_trials = int(input('Number of trials T: '))
# Generate permutation of size n
permutation = list(range(1, n + 1))
shuffle(permutation)
char[][] fillShortestPaths(char[][] plan) {
int targetX = -1;
int targetY = -1;
for (int i = 0; i < plan.length; i++) {
for (int j = 0; j < plan[0].length; j++) {
if (plan[i][j] == 's') {
targetX = i;
targetY = j;
}
}
{
"startingRoom": "Siebel",
"rooms": [
{
"name": "Siebel",
"description": "A nice place."
},
{
"name": "ECEB",
"description": "A really nice place."
@benpankow
benpankow / test.json
Last active September 27, 2017 03:00
{
"startingRoom": "Siebel",
"rooms": [
{
"name": "Siebel",
"description": "A nice place."
},
{
"name": "ECEB",
"description": "A really nice place."
/**
* CSci 1913 Lab 11
* Ryan Sjostrand and Benjamin Pankow
*
* To compile: javac Lab11.javac
* To run: java Lab11
*/
class FamilyTree
{
class Stack:
class Node:
def __init__(self, object, next):
self.object = object
self.next = next
def __init__(self):
self.head = None
/**
* CSci 1913 Lab 8
* Ryan Sjostrand and Benjamin Pankow
*
* To compile: javac Lab8.javac
* To run: java Lab8
*/
class RunnyStack<Base>
{