How to play Turbo Hearts

The game is a slight variation on regular Hearts, with a few cards having extra meaning, the possibility for a trick to go around twice, and “special” cards being “charged” (doubling their value). In Turbo Hearts, points are bad.

In Turbo Hearts, the 10♣ doubles your score final score, the J♦ gives you -10 points (good), the Q♠ is worth 13 points, and each heart is worth 1 point.

“Running” is defined as taking the Q♠ and all of the hearts. This is equivilant to “shooting the moon” in regular hearts.

Nines are also special in Turbo Hearts; if they are played in suit, they make a trick go around twice.

Charging is a technique that happens before a hand begins that has a few effects:

  • The charged suite is now worth double. A charged Q♠ is now worth 26pts, a charged A♥ makes all hearts worth 2pts, a charged 10♣ is worth 4x your final score, and a charged J♦ is worth -20pts.
  • The charged card must be placed face up in front of the player until they play it
  • There is a caviate to charging a card however, you cannot play a charged card on the first trick in suit unless you are forced to do so. An example: You charge the 10♣ and the only other club you have is the 9♣. On the first club trick, you cannot play the 10♣ since you have another club, so you play your 9, making the trick go around again. Now, you have to play a second time and since your 10♣ is the only card in suit, you must play that card.

The game consists for 4 hands with the flow of the game as follows:

  1. Passing – in order of the 4 hands: 3 left, 3 right, 3 diagonal, no passing.
  2. Charging – anyone with a chargeable card (10♣, Q♠, J♦, A♥) can now charge.
  3. Play starts – the person with the 2♣ plays first.
  4. Tricks – gameplay continues until all tricks have been claimed
  5. Scoring – scoring is tabulated and saved for later; more details below

Scoring may be the most complicated part of playing Turbo Hearts but it is really easy once you get the hang of it. Scoring is performed by totally up everyones points, multiplying if they got the 10♣, making negative if they “ran” and totally it up with the previous tricks.

We keep a notebook of scores, with each hand taking a line, the hand total on the left and the cumulative sum on the right. Negatives are wrapped in parens. It looks like this:

RF TW KB EA
0 – 0 0 – 0 72 – 72 11 – 11
16 – 16 32 – 32 (10) – 62 16 – 27
12 – 18 4 – 45 16 – 78 16 – 43
0 – 18 0 – 45 0 – 78 (248) – (205)

These are your hand scores and as you can see, I did really well on the last hand (ran for 248 pts!)

These scores are then kept cumulatively across multiple games and multiple players. Your final game score is calculated by “paying out”. What this means, is your total number of points, you must pay to all other players (and they must pay to you). It is good to have a low hand score but the opposite is true for a game score; higher scores are better.

So the final games scores are:

RF -18*3 + 35 + 78 – 205 =  -146
TW -35*3 + 18 + 78 – 205 =  -214
KB -78*3 + 18 + 35 – 205=  -386
EA 205*3 + 18 + 45 + 78 =  756

We keep these numbers are a long term tally. You can just sum up everyones game scores to see their standings.

The best way to think of these game scores is as pennies. In this game, I would be making $7.56 while the others would be paying out $1.46, $2.14, $3.86 respectively.

In my next post, I will lay out some basic strategy, but now you know how to play.

Aug
29
2009
Tags:

Terminal.app TabNamer released under GPL

Short and sweet, I have no intention of maintaining this code. It seems that snow leopard completely removes the need for it and as such, I am releasing it at github.

TabNamer @ GitHub

Archiving a message via keyboard shortcut in Microsoft Entourage

This has been driving me nuts for a long time and I finally figured out the applescript for this so I figured I should share.

The script is:

set archiveFolderName to "@Archive"
set exchangeAccount to "My Exchange Email"

tell application "Microsoft Entourage"
	repeat with msg in (get current messages)
		move msg to folder archiveFolderName in Exchange account exchangeAccount
	end repeat
end tell

This script assumes you have an exchange account and a folder in that exchange account you want to use.

If you want to use an archive folder that is a subfolder of another folder, you’ll want to tweak the script to say something like “to folder archiveFolderName in folder parentFolderName in Exchange account exchangeAccount” and add a parentFolderName variable to the top of the script.

Now all you have to do is save the script in: “~/Documents/Microsoft User Data/Entourage Script Menu Items/Archive\cA”

This will put it in your script menu and set the keystroke ctrl+a to “Archive”.

Enjoy!

Rant: Using Error Codes in User Messages

In short: DON’T!

What in the world was Apple thinking when you try to upgrade/register/sync your iPhone/iPod and you get “Error: -19″ or “Error: -20″?? What good does this do any one? How am I supposed to fix the problem if I don’t know what the problem is? Isn’t Apple the king of user-friendliness?

When you write software, you should use good error messages. You should use good exceptions. You should use descriptive values.

Granted, some things the user cannot fix. Telling the user the database connection was lost on a web application does very little good for the user. You can however tell the user that an error that was not their fault occurred. At least then I know I can come back and try again later.

Luckily, after rebooting my iPhone I was able to install the recent software update. This may not have been the problem, but certainly Apple could have notified me that I should attempt rebooting.

In any case, be nice to your damn users!

Using EclEmma to Write Better Unit Tests

If you don’t already write unit tests you should be. (Hey, why aren’t you writing unit tests?) Unit testing has so many benefits and the upfront developer cost to write some unit tests can pay huge dividends later when you aren’t spending time debugging broken code nor attempting to save face due to clueless mistakes. You can also use them as a contract to the expectations of your implementations.

So, assuming you have some unit tests, how useful are they if they don’t test everything? At some level you will want to have a good idea that you’re testing everything. (NOTE: I mean everything really important. Writing perfect 100% coverage like this would likely be too expensive for the entire codebase.) This is where Emma comes in (and more importantly for us, EclEmma, an Eclipse plugin for Emma). Emma is a code coverage tool which lets you visual which parts of your code get executed during some execution (regular or JUnit).

Lets walk through using EclEmma to ensure that we have adequate testing being done. Lets test the following two classes.
More on Using EclEmma to Write Better Unit Tests

Consistent Hashing

I don’t normally post links to other sites, but this is a great article about consistent hashing that greatly simplifies the explanation.

Mar
27
2008
Tags:

Programmers and Prison

Prison: Dark, cold, solitary, and little time outside.
Programmer’s Office: Dark, cold, solitary, and little time outside.

Sad coincidence?

Making Terminal.app Easier to Read

I really like the “Pro” color scheme for Terminal.app but I hate how hard it is to read the bold colors. By complete accident however, I came across this Options Page in Terminal.app:

terminal_options.png

Apparently, you can just click that “Use bright colors for bold text” checkbox and all of a sudden typing things like ls is no longer painful.

Just thought I’d share the tip.

Terminal.app Tab Namer v0.1 Alpha

This is a SIMBL plugin for Terminal.app on Leopard that lets you name your tabs. Because this is an Alpha, I am not going to write up instructions on where to get SIMBL, how to install it, or how to install the bundle. If you don’t already know how, then Alpha software is not for you.

That said, after installing the plugin, press Command+Shift+T to name a tab (or use the Name Tab option under the View menu).

NOTE: This has only been tested on Intel Macs with the latest version of SIMBL. If you have a PowerPC and it works for you, I’d love to hear about it in the comments.

Also, due to the nature of me giving this away for free, I cannot guarantee it won’t harm your computer, nor can I promise it will fix your marriage. This is for use AT YOUR OWN RISK. I wash my hands completely of responsibility.

Enjoy!

Terminal Tab Namer v0.1 ALPHA

Using Pretty URLs with Spring and Annotations

I’m currently working on a Java Web App with Spring. If you aren’t familiar with the Spring Framework, especially with the annotation support, then you’ve never had the pleasure of developing a web app in Java (but you may have experienced the pain). In another post, I will explain why this is so amazing, but for now lets just assume you know.

If you notice on blogs or other sites they have something called “pretty urls”. Essentially if you had a blog, this lets you have /post/welcome-to-my-site/ instead of /post/?id=33. Using the Spring Framework and the hot new annotation support in 2.5.1, you can easily achieve that.

More on Using Pretty URLs with Spring and Annotations