Skip to content

Instantly share code, notes, and snippets.

@vexorian
vexorian / problemdef.html
Last active January 1, 2016 17:29
Problem definition using Java types
<html><head><title>Definition test</title>
<style type='text/css'>
.problem-definition {
padding-left: 20px;
margin-top: 1em;
margin-bottom: 1em;
}
.problem-definitionlines {
display: table;
}
@vexorian
vexorian / problem1
Created May 20, 2015 05:40
Solution to first problem
f = [] * 3
for i in range(3):
f[i] = sum
i = 0
while i < 3:
f[i] = sum
i += 1
@vexorian
vexorian / problem2
Created May 20, 2015 05:57
problem 2
>>> import random
>>> def alternate(a,b):
... c = a + b
... d = []
... wanted = 'a'
... while len(c) > 0:
... i = random.randint(0, len(c) - 1)
... print 'Is ',c[i],' from a or b?'
... if raw_input() == wanted:
... d.append( c[i] )
@vexorian
vexorian / problem3
Created May 20, 2015 06:10
first 100 fibonacci numbers
def fibo():
A = [
[ 0, 1 ],
[ 1, 1 ],
]
x = [0, 1]
for i in range(100):
print x[0]
y = [0, 0]
(x[0], x[1]) = x[0] * A[0][0] + x[1] * A[0][1], x[0] * A[1][0] + x[1] * A[1][1]
@vexorian
vexorian / five
Created May 20, 2015 06:25
Problem 5
def five():
for x in range(3**8):
nums = []
s = '1'
for i in xrange(2,10):
d = x / (3**(i - 2)) % 3
if d == 0:
s = s + str(i)
elif d == 1:
@vexorian
vexorian / massconnect4_player.rb
Created June 1, 2015 20:37
A ruby class that parses a @massconnect4 tweet and tries to return a reply as a string
# encoding: UTF-8
# A ruby class that parses a @massconnect4 tweet and tries to return a reply as
# a string. Your bot should handle the tweet detecting and reading.
#
# connect4 = MassConnect4Player.new( team, unclever)
# team is your team either :sun or :moon
# unclever is a float from 0.0 to 1.0 , the higher this is the worse it will play
#
# connect4.play(tweet_text) , take a tweet text from @massconnect4, return a reply
#!/bin/bash
W=1280
H=720
ffmpeg -threads 12 -i "$1" -vcodec libx264 -acodec mp3 -vf "scale=$W:$H:force_original_aspect_ratio=decrease,pad=$W:$H:(ow-iw)/2:(oh-ih)/2" "$2"
[
{
"name" : "myserver",
"accessToken": "SECRET",
"uri" : "https://A-B-C-D-abaguhdsfguehdf.plex.direct:32400
}
]
@vexorian
vexorian / readme.txt
Created February 13, 2021 00:05
Clonoban (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@vexorian
vexorian / readme.txt
Created February 13, 2021 00:22
Clone Cleanup (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html