anchor.diff:              let startingMana = { red=0; green=numCott; redgreen=0; colorless=0; other=0 }
   
               // Start playing with this hand
  -            TakeAction (new GameState (library, hand, [], [],
  -                                       startingMana, noMana, 0, false))
  +            TakeAction (new GameState (library, hand, [], [], startingMana, 0, false))
   
           else
               // Can we do the special mulligan?
  
positive.code:             |> List.reduce (+)
  
          log (sprintf "Playing RiteOfFlame for a net gain of 1+%d red mana." bonusMana.red)
          gs.Mana <- gs.Mana + OneMana Red + bonusMana
          gs.Graveyard <- RiteOfFlame :: gs.Graveyard
          gs.StormCount <- gs.StormCount + 1
          TakeAction gs
  
      // Relatively cheap mana source, dead simple.
      else if (gs.Hand |> HasCard PyreticRitual &&
               CanPay (gs.PendingCosts + Cost PyreticRitual) gs.Mana) then
          log "Playing PyreticRitual for a net gain of 1 red mana."
          gs.Hand <- RemoveOneCard gs.Hand PyreticRitual
          gs.PendingCosts <- gs.PendingCosts + Cost PyreticRitual
          gs.Mana <- gs.Mana + threeRedMana
          gs.Graveyard <- PyreticRitual :: gs.Graveyard
          gs.StormCount <- gs.StormCount + 1
          TakeAction gs
  
      // Large and simple mana source.
      else if (gs.Hand |> HasCard SeethingSong &&
               CanPay (gs.PendingCosts + Cost SeethingSong) gs.Mana) then
          log "Playing SeethingSong for a net gain of 2 red mana."
          gs.Hand <- RemoveOneCard gs.Hand SeethingSong
          gs.PendingCosts <- gs.PendingCosts + Cost SeethingSong
          gs.Mana <- gs.Mana + fiveRedMana
          gs.Graveyard <- SeethingSong :: gs.Graveyard
          gs.StormCount <- gs.StormCount + 1
          TakeAction gs
  
      // This works best if we have as much mana as possible, so it's the
      // last used mana source.
      else if (gs.Hand |> HasCard DesperateRitual &&
               CanPay (gs.PendingCosts + Cost DesperateRitual) gs.Mana) then
          log "Playing DesperateRitual for a net gain of 1 red mana."
          gs.Hand <- RemoveOneCard gs.Hand DesperateRitual
          gs.PendingCosts <- gs.PendingCosts + Cost DesperateRitual
  
          // If there are other DesperateRituals in our hand, they can be
          // grafted onto this one.
          let mutable successfulGrafts = 0
          for desperateRitual in gs.Hand |> List.filter ((=) DesperateRitual) do
              if CanPay (gs.PendingCosts + Cost DesperateRitual) gs.Mana then
                  gs.PendingCosts <- gs.PendingCosts + Cost DesperateRitual
                  successfulGrafts <- successfulGrafts + 1
  
          log (sprintf "Grafted %d extra DesperateRitual for %d bonus red mana."
                       successfulGrafts (successfulGrafts * 3))
  
          while successfulGrafts > 0 do
              gs.Mana <- gs.Mana + threeRedMana  // Bonus mana for each graft.
          gs.Mana <- gs.Mana + threeRedMana      // Mana for the host card itself.
          TakeAction gs
  
      else
  
negative.code:     member val Battlefield = battlefield with get, set
      member val Graveyard = graveyard with get, set
      member val Mana = mana with get, set
      member val StormCount = stormCount with get, set
      member val PlayedLand = playedLand with get, set
      member this.Clone() = this.MemberwiseClone() :?> GameState
  