- Keep track of which groups in the winning hand are concealed and which were open (revealed).
- Calculate base points (consider each group one at a time). See base table below. Round up to next 10.
- Double the base a number of times to get the score for the round. See doubles table below.
- Cap the score at 1000 (the limit).
- If the winning tile came from a discard, each player pays the winner their score, and the loser pays double.
- If the winning tile came from the wall, all players pay the winner double the score.
- Losers do not score their hands.
This file contains 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
// Imagine if we had a test framework that did this :...( | |
const models = require('../models') | |
const logger = require('../logger') | |
const Promise = require('bluebird') | |
const co = require('co') | |
const isGenFn = require('is-generator').fn | |
const colors = require('colors/safe') | |
function transactionStrategy(mocha) { |
This file contains 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
// These may *look* like nested conditions but they run at wildly different | |
// times during your program's execution. | |
// | |
// In the example below, t represents the time elapsed since starting the | |
// code. | |
// | |
// The user clicks the button at t = 100. | |
var condition1 = true; | |
var condition2 = true; |
This file contains 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
<html> | |
<body> | |
<script> | |
var hangmanStages = [ | |
` | |
This file contains 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/ruby | |
# Annotates RSpec output with contact details of the person who wrote the tests that are failing. | |
# | |
# Setup: | |
# | |
# gem install colorize | |
# | |
# Usage: | |
# |
This file contains 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
gem 'rspec' | |
require 'rspec/core' | |
require 'rspec/expectations' | |
require 'rspec/autorun' | |
require 'pp' | |
RSpec.configure do |config| | |
config.color = true | |
config.formatter = 'doc' | |
config.expect_with :rspec do |c| |
This file contains 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
gem 'activesupport' # {}.to_query | |
gem 'nokogiri' | |
gem 'typhoeus' | |
require 'active_support/core_ext/object' | |
require 'json' | |
require 'nokogiri' | |
require 'pp' | |
require 'typhoeus' |
This file contains 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 | |
gem 'activesupport' | |
require 'active_support/core_ext/string/inflections' | |
snake = ARGV.first | |
camel = snake.camelize(:lower) | |
system %{git grep -l #{snake} | xargs ruby -p -i -e '$_.gsub! /#{snake}/, "#{camel}"'} |
This file contains 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
# More useful output from Capybara. | |
# | |
# Before: | |
# | |
# Unable to find link or button "Year 5" | |
# | |
# After: | |
# | |
# Unable to find link or button "Year 5" in "Sorry, something went wrong We've | |
# been notified of the error and are looking into it." |
This file contains 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
$ coffee blah.coffee | |
Error: Cannot find module 'coffee-script' | |
at Function.Module._resolveFilename (module.js:338:15) | |
at Function.Module._load (module.js:280:25) | |
at Module.require (module.js:364:17) | |
at require (module.js:380:17) | |
at Object.<anonymous> (/Users/greg/blah.coffee:1:10) | |
at Object.<anonymous> (/Users/greg/blah.coffee:1:1) | |
at Module._compile (module.js:456:26) |
NewerOlder