Skip to content

Instantly share code, notes, and snippets.

@arn-e
Created September 20, 2012 21:27
Show Gist options
  • Save arn-e/3758459 to your computer and use it in GitHub Desktop.
Save arn-e/3758459 to your computer and use it in GitHub Desktop.
Speed Dial Permutation Results
speed_dial = SpeedDialPermutations.new
puts speed_dial.get_combinations( ["Up","Right","Left","Down"])
# Up,Up,Up,Right (etc.)
puts speed_dial.simulate( ["Up","Right","Left","Down"],0.01,6)
# Attempt 3 Unsuccessful : Up,Left,Down,Left : Elapsed time : 8.000366121 (etc.)
puts speed_dial.average_time( ["Up","Right","Left","Down"],10000,["Up","Down","Left","Right"])
#8.534266573342666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment