 
   return false
 
+# Checks a single move to see if the Pokemon can learn it through level-up,
+# tutors, machines, Sketch, or pre-evolutions.
 checkMove = (looper, pokemon, move) ->
   {level} = pokemon
   valid = false

  minGeneration = Math.min(unportableGenerations...)
  throw new Error("Gen. '#{generation}' must be greater than #{minGeneration}.")

# Loop through the learnsets for this pokemon and all prevolutions.
# This takes all available generations into count.
loopLearnsets = (SpeciesData, FormeData, pokemon, forGeneration, iterator) ->
  minimumGeneration = getMinimumGeneration(forGeneration)
  [name, formeName] = [pokemon.name, pokemon.forme]

  # through level-up, tutoring, machines, or Sketch.
  leftoverMoves = (m  for m in moves when !checkMove(looper, pokemon, m))

  # TODO: form-change learnsets should actually be considered part of the normal
  # moveset, but only for that forme.

  # If there are no leftover moves, then we're done, the moveset is valid.
  return true  if leftoverMoves.length == 0

  # Each Pokemon has certain learnset groups. Standard ones are listed below.
  standardGroups = [ "level-up", "tutor", "machine", "egg" ]

  # Check non-standard groups:
  # "form-change", "light-ball-egg", "stadium-surfing-pikachu"
  return true  if looper (learnset) ->
    nonstandardGroups = (g  for g of learnset when g not in standardGroups)
    # If a non-standard group completely overlaps the leftover moves, the
    # moveset is valid.
    for group in nonstandardGroups
      total = (m  for m in leftoverMoves when m of learnset[group]).length
      return true  if total == leftoverMoves.length

  # This makes it so if the remaining moves are all egg moves, the moveset is
  # valid. That's false, but it's permissive. Later, factor in chain-breeding.
  # TODO: Check chain-breeding.
  eggMoves = []
  looper (learnset) ->
