Games Vs Patterns

In PlanningGame, where KentBeck (?) described their planning process in the form of a game, DaveHarris made the following...


MetaComment?: It's interesting that you structured this as a game. It feels similar to a pattern language, where the possible moves are the individual patterns. In both we have the notion of a generative grammar. Should all pattern languages be recast as games? Or should this game be recast as a pattern language? Or is there a rule - a MetaPattern - which says which form is best? Your opening comments, about "emotional distance", suggest the latter. -- DaveHarris


I have the strong feeling that there must be some link between games and pattern languages - also see BackgammonOpenings, PatternsInChess, PlayToDraw (a GoPattern). But I also have the feeling that they are not the same.

What would you think about the following hypotheses?

(1) Game rules set the grammar of a language that defines which expressions are well-formed (example: the rules of chess). Such a grammar sets a context (constraints, forces, ...) but is not dependent on a context (i.e., there are no rules that define how the rules of chess have to be generated). Such a grammar is not 'self-generative': Grammatic rules do not lead to more and more grammatic rules; once set, their number is finite (the number of rules in chess is finite). Rules also define primitive language expressions (e.g. the basic legal moves).

(2) Patterns are dependent on a context, just as expressions in a language are dependent on the grammar (a chess strategy doesn't apply to checkers, obviously). Therefore, the grammar generates patterns (Example: Winning chess strategies (architecture), chess tactics (design) and chess moves (implementation)). Also, new expressions become part of the language and thus generate even more (composite) expressions - they are self-generative (in chess books, complex patterns are often described in terms of simpler patterns).

I think all of the above can be applied to OO as well as to (building) architecture.

(Yes, I know it - some day, men in white coats are going to take me away, hahaha :) --FalkBruegmann

I would consider what a 3 year old does with a chess set compared to a 10 year old then extrapolate to grown ups with the requisite number of years experience in their field. Hint: the 3 year old doesn't quite grasp the rules but does like the way the pieces bounce off of the 10 year old. --MarkJenkins


This discussion reminds me of a book by HermannHesse entitled the GlassBeadGame or MagisterLudi which is Latin for Master of the Game.

If you are interested in Games as Patterns (or Patterns as Games) then this book is a must read. In addition you should read through all of DouglasHofstadter's books, particularly GoedelEscherBach and LeTonBeauDeMarot in which he explains how he constructed some of the patterns in the GEB book among other things.

Patterns have always intrigued me because they are a way of examining and understanding the glue in the universe. In ComputerScience patterns often take account of the glue between objects that a pure BuildingBlock? approach will tend to ignore -- MichaelDillon


Another book worth looking at in this context is FiniteAndInfiniteGames? by JamesPCarse. -- DetheElza


I don't follow FalkBruegmann's comments about context. Are you deliberately crossing levels here? A rule of chess (eg pawn moves 2 squares forward) - creates a context which enables other rules (eg en passant capture). Is this setting a context? Or are you talking about second order rules (eg which determine whether an en passant capture is a good idea)?

I like your distinction between first order rules and second order rules a lot. This is exactly the difference I wanted to express (and no, I'm not trying to mix levels :) --FalkBruegmann

Chess is a formal game with a fixed, finite grammar. Pattern languages are informal and capable of being extended, but I don't think this difference is fundamental. Especially given the PlanningGame page, where the game is both informal and extendable. Also consider TradingCardGames?, like MagicTheGathering, where the available moves depend on which cards players bring to the game, and new cards are produced frequently.

If you are talking about what I just called "second order rules", then these for chess are both informal and extensible. In this metaphor, the rules of chess are analogous to the laws of physics in Alexander's patterns. They constrain what you can do; the patterns suggest winning strategies. The contexts are (abstractions of) board positions, and patterns produce new contexts, and the set of patterns can be added to.

Anyway, I see two different metaphors here. I was originally referring to the first one - equating the rules with the patterns. Splitting a story into two stories is a legal move for Business, but not a recommended one necessarily. You need 2nd order rules/patterns to decide whether it's a good move. -- DaveHarris

You were originally equating first order rules with patterns, and I was equating second order rules with patterns. I'm going to rewrite this page using the terms first and second order rules, and then we can try to find out how both relate to patterns. First, I'll have to grok this a little, though. --FalkBruegmann

Doesn't the GameOfGo serve are a better example that Chess for this sort of thing? Go has many fewer rules than Chess, but much richer behaviour. Almost all of good Go playing relies on recognising patters, both structural (e.g. TwoEyesLive?) and dynamic (e.g. SnapBack?)


OK. Meanwhile... one of the reasons for casting it as a game was to make it feel less serious and reduce the emotional stakes of some of the participants. That seemed like the key difference, at least in this context.

I expect that can work. However, some people I know take their games very seriously indeed. They're very competitive; they want to win - where that means beating the other guys in a zero-sum game. That kind of game isn't much fun. So "game" doesn't always have the right connotations. Also, patterns can be fun too!

Maybe the difference is that people already know what games are. "Game" is probably less intimidating than "pattern language" if you don't know about them, and both are better than "generative grammar" or whatever. The word engages useful skill sets. Games - well, card games and chess, but not so much football - are fairly abstract and intellectual, even when the stakes are real.

Anyway, I think the difference between games and patterns lies in their human psychology rather than their mathematical underpinnings. -- DaveHarris


My first attempt at this was short and confusing. I don't know if this is clearer, but at least it's long... :-) Please tell me what you think. --FalkBruegmann

I will attempt to demonstrate the following:

  1. show that there are two distinct kinds of rules involved in games, and find out what the different properties are, using chess as an example

  2. map the two kinds of rules to (buildings) architecture, and show that properties stay the same

  3. map the two kinds of rules to programming and patterns, and show that the properties stay the same

  4. look at the case when patterns are expressed as games: pattern or game?

There is a small booklet by the FIDE, the world chess organization, listing all the FOR.

If you only knew the FOR, you would be able to play legal chess, but you would never win. That's what the SOR are for. They help you to come up with good chess ideas (and no, I do not think that they define good chess). SOR range from simple ("Try to put the knights close to the center of the board") to very complex, composite SOR.

What are the properties of FOR versus SOR?

Could I change a chess FOR? Certainly: "Black has the first move". That works.

Could I change a chess SOR? Let's try: "It is advantageous to put the knight in some corner". Doesn't work.

"Pawns never move backwards." Universally true. No forces involved.

"Try to put the knight..." - true? It depends. Opening or endgame? Pawn structure? ... This doesn't mean FOR cannot contain any if-clauses or don't have to be consistent (cf. en passant).

To back this up, let's do some thought experiments. Suppose you told an alien half the FOR of chess. Would it be able to come up with the other half? No, they would look different. Given all the FOR, would it be able to come up with some simple SOR? Yes, the same SOR we have. How about complex SOR? Yes, but only after having discovered or having been told certain simple SOR.

Java (1.1) standard tells me what is and isn't (legal) Java (1.1). SOR, patterns, range from idioms to design patterns and architecture patterns.

I think the FOR are only part of the pattern; the other part of the pattern is not explicitly stated. It would look something like: SOR: "In an XP-context (small team, low ceremony, ...) your planning should consist of the following moves: FOR 1, FOR 2, FOR 3, ...".


I think we might be over interpreting. I believe the PlanningGame was cast as a game simply because it has two teams each with their own set of goals. Getting to the end of the game requires each team to interact until both sides individually feel like they have won the game. Simplest thing that might possibly work. --DonWells


EditText of this page (last edited July 10, 2012) or FindPage with title or text search