The New Turtle Solver 

#!/usr/bin/perl

use strict;
use warnings;

my @cards = (
  [qw(RH GH BT YT)],
  [qw(BT RH YH GT)],
  [qw(GT RH BH YT)],
  [qw(BT GH RH YT)],
  [qw(GH BH RT YT)],
  [qw(RH YH RT BT)],
  [qw(RT BT GH YH)],
  [qw(GT BT RH YH)],
  [qw(GT YT GH BH)],
);