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:
I hereby claim:
To claim this, I am signing this object:
| extension DateComponents { | |
| static func configured(block: (inout DateComponents) -> ()) -> DateComponents { | |
| var comps = DateComponents() | |
| block(&comps) | |
| return comps | |
| } | |
| } |
| #!/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 |
| # 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 |