WFFs and Shake-a-WFF

WFF (pronounced "woof") stands for "well-formed formula." WFFs are the first building block in the classic logic game WFF 'N PROOF. The goal of WFF games such as Shake-a-WFF is to learn the structure of logical statements. Once the student has built fluency in recognizing and constructing WFFs, they will be well on their way to being able to construct and evaluate proofs.

But you can play Shake-a-WFF without being concerned with symbolic logic. In fact, kids may enjoy the game more, and get more out of it, without any discussion of formulas, logic or any educational purpose. Those things can come later.

The WFF rules: What is a WFF?

WFFs are defined by means of 9 simple rules about 9 letters. (At this point, there is no need to consider what the letters mean. They're just letters.)

Anything not defined as a WFF by these rules is not a WFF.

Single-letter WFFs

  1. The letter p is a WFF.
  2. The letter q is a WFF.
  3. The letter r is a WFF.
  4. The letter s is a WFF.



  1. The letter N followed by one WFF is a WFF.



  1. The letter C followed by two WFFs is a WFF.
  2. The letter A followed by two WFFs is a WFF.
  3. The letter K followed by two WFFs is a WFF.
  4. The letter E followed by two WFFs is a WFF.

The letters CAKE are referred to as CAKE letters.


If you work through each of the above examples carefully, mentally confirming why each one is or is not a WFF, you will have a solid grasp of the game and should not have any confusion later.

Playing the game alone

On the Shake-a-WFF page, set the number of dice you want to roll. Start with 3 if you're new to the game. This will determine the number of letters you are given, with which to build a WFF.

Click the button. You will be given a string of letters, one for each die you rolled. For example, you might have rolled Kiq.

Try to build a WFF from these letters. Use as many letters as possible. From the letters Kiq, the only possible WFF is q. This is because i is not a WFF, and you can't build a WFF with K unless you have two other WFFs to follow it. So the longest WFF you can build is q.

Type your answer into the blank following "One of the longest WFFs:". You can type parentheses if you want; it doesn't make any difference. Press the button to check whether your answer is right or not. It will tell you whether

If you got one of the longest possible WFFs, congratulations! Increase the number of dice, and roll again!

Building the longest possible WFF

For a longer example, suppose you roll 9 dice and get the letters oqRNKKosq.

The o's and the R are not accepted by any WFF rule, so we can throw those out. The remaining letters are qNKKsq.

From those we can build up a WFF as follows: KsqN(Ksq)Kq(N(Ksq)). We've now used all six letters, so there is no longer WFF possible.

There are other possible WFFs of the same length, though: for example, K(NKqs)q, or NKsKqq. Parentheses don't count toward the length of the WFF.

Sometimes you won't be able to use all the letters. For example, suppose we rolled the letters qqNEsrCEp.

There are three CAKE letters: ECE. One CAKE letter can take two single-letter WFFs, as in Eqq. Adding one more CAKE letter to an existing WFF means that we can use one more single-letter WFF: EqqC(Eqq)s. So our three CAKE letters can use up four single letters: E(C(Eqq)s)r. We can now add the N in anywhere except the end, e.g. E(C(Eqq)s)Nr.

But still have the p left, and there is no way to add it to the existing WFF because we have no more CAKE letters to combine the p with what we already have. If we build up smaller WFFs starting with p, we end up not using one of the other pqrs letters, which means we won't get a longer WFF. So E(C(Eqq)s)Nr is one of the longest possible WFFs, even though we didn't use all the available letters.

Occasionally, the dice will roll such that no WFF is possible with the letters you are given. In that case, the correct answer is simply that no WFF is possible. Clear out the "One of the longest WFFs" field and click .

Playing against each other

Agree on the number of dice. Take turns rolling. Each player, on his turn, writes down the longest WFF he can from the available letters.

Once the player whose turn it is has written down his answer, the other players check to see whether the answer is correct: Is it really a WFF? Is it as long as possible? If an opponent believes the answer is right, she says "Check." If she believes it's wrong, she says "Challenge!"

Once all the other players have said "Check" or "Challenge," if there are any challenges, each challenger has the opportunity to explain why she believes the answer was wrong. It should be possible to come to agreement on whether the answer was right or wrong. Check yourselves by typing the answer into the "One of the longest WFFs:" box and clicking the button. The computer's evaluation should be right. 😁


[These may not be exactly the original scoring rules. Check the published booklet to be sure. Or adjust them to your taste; but make sure you agree on them before the game starts!]

Once every player has had the same number of turns, if you feel ready for a bigger challenge, increase the number of dice.

Set an ending point, such as a certain number of rounds, or up to a certain number of dice. When you're done, whoever has the most points wins!

Once you are comfortable with WFFs, make some real dice and move away from the computer to play Shake-a-WFF!