plagueCount = 0

While (Pharaoh.WillLetIsraelGo == false)
    inc(plagueCount)

    if (plagueCount == 1)
        Replace(Water, with: Blood)

    if (plagueCount == 2)
        Send<Frogs>(location: Egypt)

    if (plagueCount == 3)
        Replace(Dust, with: Gnats)

    if (plagueCount == 4)
        Send<Flies>(location: Egypt.Where(area != Goshen))

    if (plagueCount == 5)
        foreach (animal in [horse, donkey, camel, cattle, sheep, goat])
            if (NOT IsAnIsraelite(animal.Owner))
                animal.Die()

    if (plagueCount == 6)
        foreach (personOrAnimal in [Egypt.People.All, Egypt.Animals.All])
            personOrAnimal.BreakOutInBoils()

    if (plagueCount == 7)
        Send<Hail(Strength.Max)>(location: Egypt.Where(area != Goshen))

    if (plagueCount == 8)
        Send<Locusts>(location: Egypt)

    if (plagueCount == 9)
        Send<Darkness.WithDuration(3.Days)>(
            location: Egypt.Where(!area.Contains(Israelites)))

    if (plagueCount == 10)
        foreach (household in Egypt.AllHouseholds)
            if (household.Doorframe.Side.Has(YearOldLambsBlood)
              & household.Doorframe.Top.Has(YearOldLambsBlood))
                PassOver()
            else
                Household.Firstborn.Kill()

See also a different response to the 10 Plagues