Skip to content

Instantly share code, notes, and snippets.

View Soryu's full-sized avatar
🌈
One Esk Nineteen

Stanley Rost Soryu

🌈
One Esk Nineteen
View GitHub Profile

Keybase proof

I hereby claim:

  • I am soryu on github.
  • I am srdoodle (https://keybase.io/srdoodle) on keybase.
  • I have a public key ASCvLp0ZCbO5O17K5mQSB8Q0r4ig3881vcbdp8I50oEorAo

To claim this, I am signing this object:

extension DateComponents {
static func configured(block: (inout DateComponents) -> ()) -> DateComponents {
var comps = DateComponents()
block(&comps)
return comps
}
}
@Soryu
Soryu / countdown.rb
Last active August 29, 2015 14:23
countdown numbers problem solver
#!/usr/bin/env ruby
# countdown numbers problem solver
#
# given a set of 6 numbers, typically `100`, `25` and four random numbers between 1 and 10
# use +, -, * and / (integer division) to arrive at a specified 3-digit target number
# numbers cannot be reused
#
# this ruby script finds the first solution from a recursive depth-first search
# see at the bottom how to run it
@Soryu
Soryu / ff13_2-clock.rb
Created February 11, 2012 22:39
Ruby program to solve clock anomaly in Final Fantasy XIII-2
# Ruby program to solve clock anomaly in Final Fantasy XIII-2
clock = [4,5,5,5,5,3,4,4,5,4,5,3]
def solve(clock, index, steps)
if clock.reduce(:+) == 0
print "Solution found!\n"
p steps
exit