This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| seq 100|perl -lpe'$r="";$_%3||($r.="Fizz");$_%5||($r.="Buzz");$_=$r||$_' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| $template_hits = 4 | |
| $blast_hits = 2 | |
| $large_blast_hits = 5 | |
| class Dice | |
| def self.d6 | |
| Proc.new { rand(6) + 1 } | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.ethelred.test; | |
| import java.util.Map; | |
| import java.util.HashMap; | |
| public class EntryTest | |
| { | |
| public static void main(String[] args) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.ethelred.test; | |
| import java.util.*; | |
| public class PriorityQueueTest | |
| { | |
| public static void main(String[] args) | |
| { | |
| int times = 20; | |
| if(args.length > 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| choose = require 'choose' | |
| pad = require 'pad' | |
| ZERO = 0 | |
| ONE = 1 | |
| Number::inverse = () -> | |
| ONE - this | |
| Number::toPercentage = () -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| def evaltarget(target) | |
| puts target | |
| lowest = [] | |
| both = [] | |
| 1.upto(6) do |a| | |
| 1.upto(6) do |b| | |
| unless a+b >= target | |
| l = [a,b].min |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| $experiments = 10000 | |
| # distance fudging - assume distance X is "within X" for rules purposes | |
| $startRange = 24 | |
| $range = $startRange | |
| $attemptChargeRange = 10 | |
| $rounds = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| $experiments = 10000 | |
| # distance fudging - assume distance X is "within X" for rules purposes | |
| $startRange = 24 | |
| $range = $startRange | |
| $attemptChargeRange = 10 | |
| $rounds = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Homebrew dependencies for Mac: | |
| # brew tap bedrock-viz/tap | |
| # brew install coreutils findutils bedrock-viz | |
| # | |
| # Also depends on docker | |
| # lazy error handling :-P | |
| set -e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require_relative 'stats' | |
| def run_test(ndice) | |
| acc = [] | |
| 0.upto((6 ** ndice) - 1) do |dscore| | |
| ds = dscore.to_s(6).rjust(ndice,'0').split(//).map{|s| s.to_i + 1} | |
| v = yield(ds) | |
| acc << v | |
| end |
OlderNewer