Skip to content

Instantly share code, notes, and snippets.

View edward3h's full-sized avatar

Edward Harman edward3h

View GitHub Profile
@edward3h
edward3h / fleet_helper.rb
Created April 30, 2015 13:41
Figure out which dice to reroll for Fleet charge
#!/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
@edward3h
edward3h / harlequin_cc.coffee
Created April 10, 2015 17:30
harlequin close combat weapons
choose = require 'choose'
pad = require 'pad'
ZERO = 0
ONE = 1
Number::inverse = () ->
ONE - this
Number::toPercentage = () ->
@edward3h
edward3h / PriorityQueueTest.java
Created September 24, 2014 15:43
Demonstrate that the iterator of a PriorityQueue does not return results in total order.
package org.ethelred.test;
import java.util.*;
public class PriorityQueueTest
{
public static void main(String[] args)
{
int times = 20;
if(args.length > 0)
@edward3h
edward3h / EntryTest.java
Created September 9, 2014 16:49
I'm getting a confusing compile error relating to Map.entrySet()
package org.ethelred.test;
import java.util.Map;
import java.util.HashMap;
public class EntryTest
{
public static void main(String[] args)
{
@edward3h
edward3h / shoot40k_6.rb
Created January 31, 2014 17:46
ruby script for super 40k mathhammer
#!/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
seq 100|perl -lpe'$r="";$_%3||($r.="Fizz");$_%5||($r.="Buzz");$_=$r||$_'