Skip to content

Instantly share code, notes, and snippets.

View janogonzalez's full-sized avatar
🐗

Jano González janogonzalez

🐗
View GitHub Profile
@janogonzalez
janogonzalez / gist:735820
Created December 10, 2010 05:12
Lucky 13 short version
import java.net.URL;
import java.util.Scanner;
public class Lucky13 {
public static int payout(int bet) throws Exception {
return "13".equals(new Scanner(new URL("http://roulette.engineyard.com/").openStream()).findInLine("\\d+")) ? bet * 35 : 0;
}
}
@janogonzalez
janogonzalez / gist:735800
Created December 10, 2010 04:47
Lucky 13: Roulette mini DSL
package com.janogonzalez.engineyard;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Scanner;
public class Roulette {
private long expected, actual, bet;